Color

Instantiates to a color type. FieldTuple is the color specifier, as parsed by the FieldList template from ae.utils.meta. By convention, each field's name indicates its purpose: - x: padding - a: alpha - l: lightness (or grey, for monochrome images) - others (r, g, b, etc.): color information

Members

Functions

opBinary
typeof(this) opBinary(T o)
opOpAssign
typeof(this) opOpAssign(int o)
typeof(this) opOpAssign(T o)

Warning: overloaded operators preserve types and may cause overflows

opUnary
typeof(this) opUnary()

Warning: overloaded operators preserve types and may cause overflows

sum
ExpandIntegerType!(ChannelType, ilog2(nextPowerOfTwo(channels))) sum()

Sum of all channels

Manifest constants

channels
enum channels;

The number of fields in this color type.

homogenous
enum homogenous;

Whether or not all channel fields have the same base type.

Static functions

blend
typeof(this) blend(typeof(this) c0, typeof(this) c1)

Alpha-blend two colors.

fromHex
typeof(this) fromHex(char[] s)

Construct an RGB color from a typical hex string.

itpl
typeof(this) itpl(typeof(this) c0, typeof(this) c1, P p, P p0, P p1)

Interpolate between two colors.

monochrome
typeof(this) monochrome(ChannelType value)

Return a Color instance with all fields set to "value".

op
typeof(this) op(T values)

Apply a custom operation for each channel. Example: COLOR.op!q{(a + b) / 2}(colorA, colorB);

Mixed In Members

From mixin FieldList!FieldTuple

Meta