Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

Color Struct Reference

List of all members.

Detailed Description

An RGBA color.


Public Member Functions

Color blend (Color o)
 Blend two colors together using the second color's opacity.

Color blend (Color o, ubyte t)
 Blend two colors together using the given opacity.

Color sblend (Color o, float t)
 Blend two colors together with a saturated blend opacity; t should be between 0 and 255.

Color blend2 (Color yx, Color xy, Color yy, ubyte a, ubyte b)
 Blend four colors together; they're positioned as in a 2x2 matrix.

void toHSV (out float h, out float s, out float v)
 Convert the color to HSV; each component is from 0 to 1.0.

void storeUByte3 (ubyte *p)
 Store into a three-cell ubyte array.

ubyte intensity ()
 Get the color's intensity.

Color inverse ()
 Return the inverse of the color, or a diametrically opposed color when a component nears 128.

char[] toString ()
 Get a string representation.

Color mul (float scale)
 Scale all parameters, where 0 results in black and 1 results in no change.

Color mulass (float scale)
 Multiply and assign.

Color add (Color other)
 Add two colors together.

Color addass (Color other)
 Add and assign.


Static Public Member Functions

Color fromHSV (float h, float s, float v)
 Get a color from HSV.

Color fromHSV (float h, float s, float v, ubyte a)
 Get a color from HSV, with an explicit opacity.


Public Attributes

ubyte r = 0
 The red component, from 0 (black) to 255 (red).

ubyte g = 0
 The green component, from 0 (black) to 255 (green).

ubyte b = 0
 The blue component, from 0 (black) to 255 (blue).

ubyte a = 255
 The opacity component, from 0 (transparent) to 255 (opaque).

const Color Black = { 0, 0, 0, 255 }
 The color black.

const Color White = { 255, 255, 255, 255 }
 The color white.

const Color Trans = { 0, 0, 0, 0 }
 A transparent color.


Related Functions

(Note that these are not member functions.)

Color AColor (ubyte r, ubyte g, ubyte b)
 Construct a color, using 255 for opacity.

Color AColor (ubyte r, ubyte g, ubyte b, ubyte a)
 Construct a color with explicit opacity.

Color SColor (float r, float g, float b)
 Construct a color, saturating each attribute to be in range.

Color SColor (float r, float g, float b, float a)
 Construct a color, saturating each attribute to be in range.

Color SColor1 (float r, float g, float b)
 Construct a color with 0-1 range on each component.

Color SColor1 (float r, float g, float b, float a)
 Construct a color with 0-1 range on each component.


Member Function Documentation

Color Color.add Color  other  ) 
 

Add two colors together.

Opacity is unmolested.

Color Color.blend2 Color  yx,
Color  xy,
Color  yy,
ubyte  a,
ubyte  b
 

Blend four colors together; they're positioned as in a 2x2 matrix.

The left and right colors are blended using a, then those top and bottom colors are blended using b.

Color Color.mul float  scale  ) 
 

Scale all parameters, where 0 results in black and 1 results in no change.

Opacity is passed unmolested.


The documentation for this struct was generated from the following file:
Generated on Thu Sep 4 13:12:51 2003 for dig by doxygen 1.3.2