Constructorsconstructor new Color ( color : string ) : Color Methodsget Brightness getBrightness () : number Returns number get Contrast Ratio getContrastRatio ( color : string | Color ) : number Returns number get Format getFormat () : string Returns string get Input getInput () : string Returns string get Luminance getLuminance () : number Returns number get Opaque Color getOpaqueColor ( opacity ?: number ) : Color getRGBA getRGBA () : { a : number ; b : number ; g : number ; r : number } Returns { a : number ; b : number ; g : number ; r : number } is Transparent isTransparent () : boolean Returns boolean is Valid isValid () : boolean Returns boolean to Compressed String toCompressedString () : string Returns string to String toString () : string Returns string Static
compress compress ( expression : string ) : null | string Returns null | string Static
get Opaque Color getOpaqueColor ( color : string | Color , opacity ?: number ) : string Parameters color : string | Color Optional
opacity : number Returns string Static
get Text Color getTextColor ( color : string | Color ) : string Returns string Static
is Equal isEqual ( color1 : string | Color , color2 : string | Color ) : boolean Returns boolean Static
is Transparent isTransparent ( color ?: null | string ) : boolean Parameters Optional
color : null | string Returns boolean Static
parse parse ( expression ?: null | string ) : null | Color Parameters Optional
expression : null | string Returns null | Color Static
random random ( saturation ?: number , lightness ?: number , steps ?: number , step ?: number , ) : string Parameters Optional
saturation : number Optional
lightness : number Optional
steps : number Optional
step : number Returns string Static
validate validate ( expression : string ) : boolean Returns boolean
Simple object representing an RGBA color can be initialized from any valid CSS Expression