Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno_class_validator/src/index.ts>IsRgbColor

Decorator-based property validation for classes.
Latest
function IsRgbColor
import { IsRgbColor } from "https://deno.land/x/deno_class_validator@v1.0.0/src/index.ts";

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

optional
includePercentValues: boolean
optional
validationOptions: ValidationOptions

Returns

PropertyDecorator