Public Member Functions
GUI::ColourRect Class Reference

Class that holds details of colours for the four corners of a rectangle. More...

List of all members.

Public Member Functions

void setAlpha (float alpha)
 Set the alpha value to use for all four corners of the ColourRect.
void setTopAlpha (float alpha)
 Set the alpha value to use for the top edge of the ColourRect.
void setBottomAlpha (float alpha)
 Set the alpha value to use for the bottom edge of the ColourRect.
void setLeftAlpha (float alpha)
 Set the alpha value to use for the left edge of the ColourRect.
void setRightAlpha (float alpha)
 Set the alpha value to use for the right edge of the ColourRect.
bool isMonochromatic ()
 Determinate the ColourRect is monochromatic or variegated.
ColourRect getSubRectangle (float left, float right, float top, float bottom)
 Gets a portion of this ColourRect as a subset ColourRect.
Colour getColourAtPoint (float x, float y)
 Get the colour at a point in the rectangle.
void setColours (Colour col)
 Set the colour of all four corners simultaneously.
void modulateAlpha (float alpha)
 Module the alpha components of each corner's colour by a constant.
void modulateColours (ColourRect other)
 Modulate all components of this colour rect with corresponding components from another colour rect.

Writable Variables

Colour top_left
Colour top_right
Colour bottom_left
Colour bottom_right
 ColourRect component colours.

Detailed Description

Class that holds details of colours for the four corners of a rectangle.


Member Function Documentation

void GUI::ColourRect::setAlpha ( float  alpha)

Set the alpha value to use for all four corners of the ColourRect.

Parameters:
alphaAlpha value to use.
Returns:
Nothing.
void GUI::ColourRect::setTopAlpha ( float  alpha)

Set the alpha value to use for the top edge of the ColourRect.

Parameters:
alphaAlpha value to use.
Returns:
Nothing.
void GUI::ColourRect::setBottomAlpha ( float  alpha)

Set the alpha value to use for the bottom edge of the ColourRect.

Parameters:
alphaAlpha value to use.
Returns:
Nothing.
void GUI::ColourRect::setLeftAlpha ( float  alpha)

Set the alpha value to use for the left edge of the ColourRect.

Parameters:
alphaAlpha value to use.
Returns:
Nothing.
void GUI::ColourRect::setRightAlpha ( float  alpha)

Set the alpha value to use for the right edge of the ColourRect.

Parameters:
alphaAlpha value to use.
Returns:
Nothing.
bool GUI::ColourRect::isMonochromatic ( )

Determinate the ColourRect is monochromatic or variegated.

Returns:
True if all four corners of the ColourRect has same colour, false otherwise.
ColourRect GUI::ColourRect::getSubRectangle ( float  left,
float  right,
float  top,
float  bottom 
)

Gets a portion of this ColourRect as a subset ColourRect.

Parameters:
leftThe left side of this subrectangle (in the range of 0-1 float)
rightThe right side of this subrectangle (in the range of 0-1 float)
topThe top side of this subrectangle (in the range of 0-1 float)
bottomThe bottom side of this subrectangle (in the range of 0-1 float)
Returns:
A ColourRect from the specified range
Colour GUI::ColourRect::getColourAtPoint ( float  x,
float  y 
)

Get the colour at a point in the rectangle.

Parameters:
xThe x coordinate of the point
yThe y coordinate of the point
Returns:
The colour at the specified point.
void GUI::ColourRect::setColours ( Colour  col)

Set the colour of all four corners simultaneously.

Parameters:
colcolour that is to be set for all four corners of the ColourRect;
void GUI::ColourRect::modulateAlpha ( float  alpha)

Module the alpha components of each corner's colour by a constant.

Parameters:
alphaThe constant factor to modulate all alpha colour components by.