RGB

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

Constructors

this
this(const(C)[] str)

Construct a color from a string.

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(ComponentType.IntType r, ComponentType.IntType g, ComponentType.IntType b, ComponentType.IntType a)

Construct a color from RGB and optional alpha values.

this
this(ComponentType.IntType l, ComponentType.IntType a)

Construct a color from a luminance and optional alpha value.

Members

Aliases

ComponentType
alias ComponentType = ComponentType_

Type of the color components.

ComponentType
alias ComponentType = NormalizedInt!ComponentType_

Type of the color components.

ParentColor
alias ParentColor = XYZ!(FloatTypeFor!ComponentType)
Undocumented in source.

Functions

opBinary
typeof(this) opBinary(typeof(this) rh)

Binary operators.

opBinary
typeof(this) opBinary(S rh)

Binary operators.

opCast
Color opCast()

Cast to other color types.

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

Binary assignment operators.

opOpAssign
typeof(this) opOpAssign(S rh)

Binary assignment operators.

opUnary
typeof(this) opUnary()

Unary operators.

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).

Static functions

convertColorImpl
To convertColorImpl(From color)
Undocumented in source. Be warned that the author may not have intended to support it.
convertColorImpl
To convertColorImpl(From color)
Undocumented in source. Be warned that the author may not have intended to support it.
convertColorImpl
To convertColorImpl(From color)
Undocumented in source. Be warned that the author may not have intended to support it.

Templates

Components
template Components(string components)
Undocumented in source.

Variables

colorSpace
enum RGBColorSpace colorSpace;

The colors color space.

colorSpaceDesc
enum RGBColorSpaceDesc!F colorSpaceDesc(F = double);

The color space descriptor.

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