3rd Eye Scene C#
3rd Eye Scene C# documentation
Tes::Maths::Colour Struct Reference

A utility class representing a colour as a 32-bit integer. More...

List of all members.

Public Types

enum  Channel { B, G, R, A }
 An enumeration of the various colour channels. More...

Public Member Functions

 Colour (uint value)
 Initialises a colour from a 32-bit integer.
 Colour (int r, int g, int b, int a=255)
 Initialises a colour from individual colour values.
byte GetChannel (Channel c)
 Get the value of the requested colour channel.
void SetChannel (Channel c, byte val)
 Set the value of the indicated colour channel.

Static Public Member Functions

static int GetShift (Channel c)
 Returns the bit shift required to access the requested colour channel c .
static Colour Cycle (uint number, ColourCycle cycle=ColourCycle.StandardCycle)
 Return a colour from one of the standard ColourCycle sets.

Public Attributes

uint Value
 The 32-bit colour value in the form: 0xRRGGBBAAu.

Static Public Attributes

static readonly Colour[] Colours
 Predefined colour array.
static readonly int[] DefaultColourSet
 A predefined set of colours which attempts to distinguish consecutive colours.
static readonly int[] DeuteranomalyColourSet
 A colour set which attempts to be deuteranomoly colour blind friendly.
static readonly int[] ProtanomalyColourSet
 A colour set which attempts to be protanomoly colour blind friendly.
static readonly int[] TritanomalyColourSet
 A colour set which attempts to be trianomoly colour blind friendly.
static readonly int[] GreyColourSet
 A greyscale colour set.
static readonly int[][] ColourCycles
 Encapsulates the various standard colour cycles into an array.

Properties

byte R [get, set]
 Gets or sets the red channel.
byte G [get, set]
 Gets or sets the green channel.
byte B [get, set]
 Gets or sets the blue channel.
byte A [get, set]
 Gets or sets the alpha channel.

Detailed Description

A utility class representing a colour as a 32-bit integer.

The Value is represents a colour channels in the form 0xRRGGBBAAu. Each channel is accessible via Properties.


Member Enumeration Documentation

An enumeration of the various colour channels.

Enumerator:
B 

Blue.

G 

Green.

R 

Red.

A 

Alpha.


Constructor & Destructor Documentation

Tes::Maths::Colour::Colour ( uint  value) [inline]

Initialises a colour from a 32-bit integer.

Simply copies the value.

Parameters:
valueThe colour value.
Tes::Maths::Colour::Colour ( int  r,
int  g,
int  b,
int  a = 255 
) [inline]

Initialises a colour from individual colour values.

Parameters:
rThe red component.
gThe green component.
bThe blue component.
aThe alpha component.

Member Function Documentation

static Colour Tes::Maths::Colour::Cycle ( uint  number,
ColourCycle  cycle = ColourCycle.StandardCycle 
) [inline, static]

Return a colour from one of the standard ColourCycle sets.

Parameters:
numberAn indexing value in the colour cycle. May be out of range as it is wrapped.
cycleThe colour cycle to use.
Returns:
A colour from the selected cycle.

Using this method it is possible to use a monotonic number as as indexing value. The value is wrapped to the cycle length, guaranteeing valid colour from the set.

byte Tes::Maths::Colour::GetChannel ( Channel  c) [inline]

Get the value of the requested colour channel.

Parameters:
cThe requested channel.
Returns:
The value of the requested colour channel.
static int Tes::Maths::Colour::GetShift ( Channel  c) [inline, static]

Returns the bit shift required to access the requested colour channel c .

Parameters:
cThe requested colour channel.
Returns:
The bit shift required to move the requested into or out of byte zero.
void Tes::Maths::Colour::SetChannel ( Channel  c,
byte  val 
) [inline]

Set the value of the indicated colour channel.

Parameters:
cThe requested channel.
valThe value for the indicates colour channel.

Member Data Documentation

readonly int [][] Tes::Maths::Colour::ColourCycles [static]
Initial value:

Encapsulates the various standard colour cycles into an array.

Initial value:
 new int[]
    {
      (int)PredefinedColour.RoyalBlue,
      (int)PredefinedColour.Yellow,
      (int)PredefinedColour.Silver,
      (int)PredefinedColour.Black,
      (int)PredefinedColour.Blue,
      (int)PredefinedColour.Khaki,
      (int)PredefinedColour.Gainsboro,
      (int)PredefinedColour.Beige,
      (int)PredefinedColour.Navy,
      (int)PredefinedColour.DarkKhaki,
      (int)PredefinedColour.White,
      (int)PredefinedColour.Grey,
      (int)PredefinedColour.MidnightBlue,
      (int)PredefinedColour.SlateGrey,
      (int)PredefinedColour.Ivory,
      (int)PredefinedColour.Gold,
      (int)PredefinedColour.DarkSlateBlue,
      (int)PredefinedColour.MediumSlateBlue
    }

A colour set which attempts to be deuteranomoly colour blind friendly.

readonly int [] Tes::Maths::Colour::GreyColourSet [static]
Initial value:
 new int[]
    {
      (int)PredefinedColour.Black,
      (int)PredefinedColour.Silver,
      (int)PredefinedColour.DarkSlateGrey,
      (int)PredefinedColour.Grey,
      (int)PredefinedColour.Gainsboro,
      (int)PredefinedColour.SlateGrey,
    }

A greyscale colour set.

readonly int [] Tes::Maths::Colour::ProtanomalyColourSet [static]
Initial value:
 new int[]
    {
      (int)PredefinedColour.Blue,
      (int)PredefinedColour.Yellow,
      (int)PredefinedColour.Black,
      (int)PredefinedColour.Silver,
      (int)PredefinedColour.CornflowerBlue,
      (int)PredefinedColour.Gainsboro,
      (int)PredefinedColour.MediumSlateBlue,
      (int)PredefinedColour.Khaki,
      (int)PredefinedColour.Grey,
      (int)PredefinedColour.DarkBlue,
      (int)PredefinedColour.Beige,
      (int)PredefinedColour.DarkKhaki,
      (int)PredefinedColour.MidnightBlue,
      (int)PredefinedColour.SlateGrey,
      (int)PredefinedColour.RoyalBlue,
      (int)PredefinedColour.Ivory,
      (int)PredefinedColour.DarkSlateBlue,
    }

A colour set which attempts to be protanomoly colour blind friendly.

readonly int [] Tes::Maths::Colour::TritanomalyColourSet [static]
Initial value:
 new int[]
    {
      (int)PredefinedColour.DeepSkyBlue,
      (int)PredefinedColour.DeepPink,
      (int)PredefinedColour.PaleTurquoise,
      (int)PredefinedColour.Black,
      (int)PredefinedColour.Crimson,
      (int)PredefinedColour.LightSeaGreen,
      (int)PredefinedColour.Gainsboro,
      (int)PredefinedColour.Blue,
      (int)PredefinedColour.DarkRed,
      (int)PredefinedColour.Silver,
      (int)PredefinedColour.Brown,
      (int)PredefinedColour.DarkTurquoise,
      (int)PredefinedColour.Grey,
      (int)PredefinedColour.Maroon,
      (int)PredefinedColour.Teal,
      (int)PredefinedColour.SlateGrey,
      (int)PredefinedColour.MidnightBlue,
      (int)PredefinedColour.DarkSlateGrey,
    }

A colour set which attempts to be trianomoly colour blind friendly.


Property Documentation

byte Tes::Maths::Colour::A [get, set]

Gets or sets the alpha channel.

The alpha value.

byte Tes::Maths::Colour::B [get, set]

Gets or sets the blue channel.

The blue value.

byte Tes::Maths::Colour::G [get, set]

Gets or sets the green channel.

The green value.

byte Tes::Maths::Colour::R [get, set]

Gets or sets the red channel.

The red value.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties Events