DefColor

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

Aliases

ChannelType
alias ChannelType = typeof(Fields.init.tupleof[0])
Undocumented in source.
Spec
alias Spec = FieldTuple
Undocumented in source.

Functions

opBinary
typeof(this) opBinary(T o)

Warning: overloaded operators preserve types and may cause overflows

opCast
T opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
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

toHex
string toHex()

Construct an RGB color from a typical hex string.

Manifest constants

channelBits
enum channelBits;
Undocumented in source.
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.

Mixins

__anonymous
mixin FieldList!FieldTuple
Undocumented in source.

Static functions

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

Meta