The OpenD Programming Language

HSx

HSx color space is used to describe a suite of angular color spaces including HSL, HSV, HSI, HCY.

Constructors

this
this(HueType h, ComponentType s, ComponentType x)

Construct a color from hsx components.

this
this(HueType h, ComponentType.IntType s, ComponentType.IntType x)

Construct a color from hsx components.

Members

Aliases

ComponentType
alias ComponentType = ComponentType_

Type of the s and x components.

ComponentType
alias ComponentType = NormalizedInt!ComponentType_

Type of the s and x components.

HueType
alias HueType = ComponentType_

Type of the hue components.

HueType
alias HueType = ComponentType_

Type of the hue components.

Functions

opCast
Color opCast()

Cast to other color types.

Manifest constants

colorSpace
enum colorSpace;

The parent RGB color space.

Properties

degrees
double degrees [@property getter]

Get hue angle in degrees.

degrees
double degrees [@property setter]

Set hue angle in degrees.

radians
double radians [@property getter]

Get hue angle in radians.

radians
double radians [@property setter]

Set hue angle in radians.

Variables

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

The parent RGB color space descriptor.

type
enum HSxType type;

The color type from the HSx family.

Parameters

ComponentType_

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

colorSpace_

Color will be within the specified RGB color space.

Examples

// HSV color with float components
alias HSVf = HSV!float;

HSVf c = HSVf(3.1415, 1, 0.5);

// test HSV operators and functions
// HSL color with float components
alias HSLf = HSL!float;

HSLf c = HSLf(3.1415, 1, 0.5);

// test HSL operators and functions
// HSI color with float components
alias HSIf = HSI!float;

HSIf c = HSIf(3.1415, 1, 0.5);

// test HSI operators and functions
// HCY color with float components
alias HCYf = HCY!float;

HCYf c = HCYf(3.1415, 1, 0.5);

// test HCY operators and functions

Meta