The OpenD Programming Language

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.

Functions

opBinary
typeof(this) opBinary(S rh)

Binary operators.

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

Binary operators.

opCast
Color opCast()

Cast to other color types.

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

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