Interface ColorLikeSource

Merge declaration with this interface to add more types to ColorLike type.

interface ColorLikeSource {
    paint-bucket: undefined | null | Color;
    paint-bucket/plugin/css: string;
    paint-bucket/plugin/rgb: number | [red: number, green: number, blue: number, alpha: number];
    paint-bucket/plugin/x11: string;
}

Properties

paint-bucket: undefined | null | Color
paint-bucket/plugin/css: string

Parses color from CSS string.

clr('hsl(290, 20%, 50% / 80%)').css();
// ⮕ rgba(145,102,153,0.80)
paint-bucket/plugin/rgb: number | [red: number, green: number, blue: number, alpha: number]

Creates the new color from RGBa components. Components can be represented as a 24-bit integer RGB color, or an array of separate component values where red, green and blue ∈ [0, 255] and alpha ∈ [0, 1] (0 = transparent, 1 = opaque). If the red, green or blue component is omitted it is set to 0. If alpha component is omitted it is set to 1.

clr([255, 255, 255, 0.5]); // Semi-transparent white

clr([, , 255]); // Opaque blue color

clr(0x00_00_ff);
paint-bucket/plugin/x11: string

Creates a new color using its X11 color name.

clr('royalblue');