Skip to main content
Module

x/leaves/mod.ts>validator.isRgbColor

A Web framework For Deno with Decorator and middleware
Latest
function validator.isRgbColor
import { validator } from "https://deno.land/x/leaves@v0.1.5/mod.ts";
const { isRgbColor } = validator;

Check if the string is a rgb or rgba color. includePercentValues defaults to true. If you don't want to allow to set rgb or rgba values with percents, like rgb(5%,5%,5%), or rgba(90%,90%,90%,.3), then set it to false. If given value is not a string, then it returns false.

Parameters

value: unknown
optional
includePercentValues: boolean

Returns

boolean