Color

A container for the pixel values: red, green, blue and opacity.

Constructors

this
this()
this
this(Quantum red, Quantum green, Quantum blue, Quantum opacity)

Create a Color from the specified Quantums.

this
this(string color)

Create a Color from a X11 color specification string

this
this(PixelPacket packet)

Create a Color from this PixelPacket.

this
this(PixelPacket* packet)

Create a Color and set the internal pointer to this PixelPacket. We can use this to change pixels in an image through Color.

Members

Functions

blueQuantum
void blueQuantum(Quantum blue)
Quantum blueQuantum()

The value for blue in the range [0 .. QuantumRange]

clone
Color clone()

Create a copy of this Color.

greenQuantum
void greenQuantum(Quantum green)
Quantum greenQuantum()

The value for green in the range [0 .. QuantumRange]

intensity
double intensity()

The intensity of this color.

name
string name()

Returns the name of the color or the value as a hex string.

opCast
Object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
T opCast()

Support casting between different colors. You can also use std.conv.to

opEquals
bool opEquals(Object obj)
opacity
void opacity(double opacity)
double opacity()

The value for opacity as a double in the range [0.0 .. 1.0]

opacityByte
void opacityByte(ubyte opacity)
ubyte opacityByte()

The opacity as a byte. [0 .. 255]

opacityQuantum
void opacityQuantum(Quantum opacity)
Quantum opacityQuantum()

The value for opacity in the range [0 .. QuantumRange]

pixelPacket
PixelPacket pixelPacket()
Undocumented in source. Be warned that the author may not have intended to support it.
pixelPacket
void pixelPacket(PixelPacket packet)
Undocumented in source. Be warned that the author may not have intended to support it.
redQuantum
void redQuantum(Quantum red)
Quantum redQuantum()

The value for red in the range [0 .. QuantumRange]

toString
string toString()

Returns the value as a hex string.

Static functions

scaleDoubleToQuantum
Quantum scaleDoubleToQuantum(double value)
Undocumented in source. Be warned that the author may not have intended to support it.
scaleQuantumToDouble
double scaleQuantumToDouble(Quantum value)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

packet
PixelPacket* packet;
Undocumented in source.

Meta