C++ API Library Reference  4.3.2-74-ge1d4cca
Public Functions | Public Static Functions | List of all members
PureWebColor Struct Reference

The PureWebColor class provides methods to work with colors and make color format conversions. It is meant to be used in conjunction with collaboration and acetate; the service assigns distinct PureWebColor instances to each collaboration session, allowing acetate drawn by different sessions to be distinguished. A PureWebColor object represents a color in terms of alpha, red, green, and blue components. PureWeb colors are the same across platforms.

For methods that expect or return a color name, refer to PureWebKnownColor for the list of supported color names.

Public Functions

Byte A () const
 
Byte B () const
 
Byte G () const
 
HashCode GetHashCode () const
 
bool operator!= (PureWebColor const &other) const
 
bool operator== (PureWebColor const &other) const
 
Byte R () const
 
Int32 ToAbgr () const
 
Int32 ToArgb () const
 
String ToString () const
 
Constructors and Destructors
 PureWebColor ()
 
 ~PureWebColor ()
 

Public Static Functions

static PureWebColor FromArgb (Byte a, Byte r, Byte g, Byte b)
 
static PureWebColor FromKnownColor (PureWebKnownColor::Enum color)
 
static PureWebColor FromKnownName (String const &name)
 
static PureWebColor FromRgb (Byte r, Byte g, Byte b)
 
static bool TryParse (String value, PureWebColor &result)
 

Usage Description

Byte A ( ) const
inline

Returns the alpha component of the color. A value of 0 is completely transparent, a value of 255 is completely opaque.

Byte B ( ) const
inline

Returns the blue component of the color.

PureWebColor FromArgb ( Byte  a,
Byte  r,
Byte  g,
Byte  b 
)
static

Returns a color from the specified ARGB components.

Parameters
aThe alpha component.
rThe red component.
gThe green component.
bThe blue component.
PureWebColor FromKnownColor ( PureWebKnownColor::Enum  color)
static

Returns a color from the specified known color.

PureWebColor FromKnownName ( String const &  name)
static

Returns a color from the specified known color name.

PureWebColor FromRgb ( Byte  r,
Byte  g,
Byte  b 
)
static

Returns a color from the specified RGB components.

Parameters
rThe red component.
gThe green component.
bThe blue component.
Byte G ( ) const
inline

Returns the green component of the color.

HashCode GetHashCode ( ) const

Returns this instance of PureWebColor expressed as a hashcode.

bool operator!= ( PureWebColor const &  other) const
inline

Checks whether the current instance is equal or not to the specified color; returns true if they are not equal, otherwise returns false.

bool operator== ( PureWebColor const &  other) const
inline

Checks whether the current instance is equal or not to the specified color; returns true if they are equal, otherwise returns false.

Byte R ( ) const
inline

Returns the red component of the color.

Int32 ToAbgr ( ) const

Returns the color as a 32-bit ABGR value. Alpha is stored in bits 24-31. Blue is stored in bits 16-23. Green is stored in bits 8-15. Red is stored in bits 0-7.

Int32 ToArgb ( ) const

Returns the color as a 32-bit ARGB value. Alpha is stored in bits 24-31. Red is stored in bits 16-23. Green is stored in bits 8-15. Blue is stored in bits 0-7.

String ToString ( ) const

Returns this instance of PureWebColor expressed as a string.

bool TryParse ( String  value,
PureWebColor result 
)
static

Tries to parse the string into a color.