Color
Defined in: color.ts:90
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Color(
input):Color
Defined in: color.ts:109
constructor
Parameters
Section titled “Parameters”string | number[] | RGBA | Color
Returns
Section titled “Returns”Color
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get rgb():
RGBA
Defined in: color.ts:137
Returns
Section titled “Returns”- the color
Set Signature
Section titled “Set Signature”set rgb(
obj):void
Defined in: color.ts:148
Parameters
Section titled “Parameters”the color
Returns
Section titled “Returns”void
Get Signature
Section titled “Get Signature”get valid():
boolean
Defined in: color.ts:130
true if this is a valid color
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”alpha()
Section titled “alpha()”alpha(
a):Color
Defined in: color.ts:236
Set alpha
Parameters
Section titled “Parameters”number
the alpha [0..1]
Returns
Section titled “Returns”Color
clearer()
Section titled “clearer()”clearer(
ratio):Color
Defined in: color.ts:246
Make clearer
Parameters
Section titled “Parameters”number
ratio [0..1]
Returns
Section titled “Returns”Color
clone()
Section titled “clone()”clone():
Color
Defined in: color.ts:227
Clone
Returns
Section titled “Returns”Color
darken()
Section titled “darken()”darken(
ratio):Color
Defined in: color.ts:302
Darken
Parameters
Section titled “Parameters”number
ratio [0..1]
Returns
Section titled “Returns”Color
desaturate()
Section titled “desaturate()”desaturate(
ratio):Color
Defined in: color.ts:322
Desaturate
Parameters
Section titled “Parameters”number
ratio [0..1]
Returns
Section titled “Returns”Color
greyscale()
Section titled “greyscale()”greyscale():
Color
Defined in: color.ts:256
Convert to grayscale
Returns
Section titled “Returns”Color
hexString()
Section titled “hexString()”hexString():
string
Defined in: color.ts:164
hex string
Returns
Section titled “Returns”string
hslString()
Section titled “hslString()”hslString():
string
Defined in: color.ts:172
hsl(a) string
Returns
Section titled “Returns”string
interpolate()
Section titled “interpolate()”interpolate(
color,t):Color
Defined in: color.ts:216
Interpolate a color value between this and color
Parameters
Section titled “Parameters”Color
number
0..1
Returns
Section titled “Returns”Color
lighten()
Section titled “lighten()”lighten(
ratio):Color
Defined in: color.ts:292
Lighten
Parameters
Section titled “Parameters”number
ratio [0..1]
Returns
Section titled “Returns”Color
mix(
color,weight?):Color
Defined in: color.ts:190
Mix another color to this color.
Parameters
Section titled “Parameters”Color
Color to mix in
weight?
Section titled “weight?”number = 0.5
0..1
Returns
Section titled “Returns”Color
negate()
Section titled “negate()”negate():
Color
Defined in: color.ts:279
Negates the rgb value
Returns
Section titled “Returns”Color
oklchString()
Section titled “oklchString()”oklchString():
string
Defined in: color.ts:180
oklch string
Returns
Section titled “Returns”string
opaquer()
Section titled “opaquer()”opaquer(
ratio):Color
Defined in: color.ts:269
Opaquer
Parameters
Section titled “Parameters”number
ratio [0..1]
Returns
Section titled “Returns”Color
rgbString()
Section titled “rgbString()”rgbString():
string
Defined in: color.ts:156
rgb(a) string
Returns
Section titled “Returns”string
rotate()
Section titled “rotate()”rotate(
deg):Color
Defined in: color.ts:332
Rotate
Parameters
Section titled “Parameters”number
degrees to rotate
Returns
Section titled “Returns”Color
saturate()
Section titled “saturate()”saturate(
ratio):Color
Defined in: color.ts:312
Saturate
Parameters
Section titled “Parameters”number
ratio [0..1]
Returns
Section titled “Returns”Color