RGB

An RGB color, parameterised with components, component type, and color space specification.

Constructors

this
this(ComponentType r, ComponentType g, ComponentType b, ComponentType a)

Construct a color from RGB and optional alpha values.

this
this(ComponentType l, ComponentType a)

Construct a color from a luminance and optional alpha value.

this
this(const(C)[] hex)

Construct a color from a hex string.

Members

Aliases

ComponentType
alias ComponentType = ComponentType_

Type of the color components.

Functions

opCast
Color opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(this) rh)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin ColorOperators!AllComponents
Undocumented in source.

Properties

tristimulus
auto tristimulus [@property getter]

Return the RGB tristimulus values as a tuple. These will always be ordered (R, G, B). Any color channels not present will be 0.

tristimulusWithAlpha
auto tristimulusWithAlpha [@property getter]

Return the RGB tristimulus values + alpha as a tuple. These will always be ordered (R, G, B, A).

Templates

Components
template Components(string components)
Undocumented in source.

Variables

colorSpace
enum RGBColorSpace colorSpace;

The color space specified.

components
enum string components;

The color components that were specified.

hasAlpha
enum bool hasAlpha;

If the color has alpha.

hasComponent
enum bool hasComponent(char c);

Test if a particular component is present.

linear
enum bool linear;

If the color is stored linearly (without gamma applied).

Parameters

ComponentType_

Type for the color channels. May be a basic integer or floating point type.

linear_

Color is stored with linear luminance.

colorSpace_

Color will be within the specified color space.

Meta