colors.types

Monomorphic color type, to represent any tristimulus + alpha.

Members

Aliases

hsla
alias hsla = hsl

In CSS, the hsla function is simply in alias of rgb. You can specify an alpha to rgb, or omit it with rgba.

rgba
alias rgba = rgb

In CSS, the rgba function is simply in alias of rgb. You can specify an alpha to rgb, or omit it with rgba.

Functions

hsl
Color hsl(float hueDegrees, float sat, float light, float alpha)

The hsl function is the same as in CSS color specifications.

rgb
Color rgb(float red, float green, float blue, float alpha)

The rgb function is the same as in CSS color specifications.

toColorSpace
Color toColorSpace(const(Color) color, Colorspace target)

Convert a Color in-place to another colorspace.

Structs

Color
struct Color

The Color type is a tagged union that can hold one color in a CSS-defined colorspace. This correspond to both "specified", "computed", and "used" colors in CSS specification. In typical use, you'll want to map to sRGB 32-bit RGBA quadruplet, and the function for this is called: toRGBA8(). Reference: https://www.w3.org/TR/css-color-4/

Meta