C# / .Net API Library Reference  4.3.2-74-ge1d4cca
Public Functions | Public Static Functions | Properties
PureWebColor Struct Reference

The PureWebColor class provides methods to work with colors and make color format conversions. It represents a color in terms of alpha, red, green, and blue components.

PureWeb colors are the same across platforms. They are used by the client-side acetate tools to display markup of view overlays. For methods that expect or return a color name, refer to PureWebKnownColor for the list of supported color names.

Public Functions

override bool Equals (object obj)
 
override int GetHashCode ()
 
int ToAbgr ()
 
int ToArgb ()
 
override string ToString ()
 

Public Static Functions

static PureWebColor FromArgb (byte a, byte r, byte g, byte b)
 
static PureWebColor FromKnownColor (PureWebKnownColor color)
 
static PureWebColor FromKnownName (string name)
 
static PureWebColor FromRgb (byte r, byte g, byte b)
 
static implicit operator PureWebColor (System.Windows.Media.Color color)
 
static implicit operator PureWebColor (System.Drawing.Color color)
 
static implicit operator System.Drawing.Color (PureWebColor color)
 
static implicit operator System.Windows.Media.Color (PureWebColor color)
 
static bool operator!= (PureWebColor left, PureWebColor right)
 
static bool operator== (PureWebColor left, PureWebColor right)
 
static bool TryParse (string value, out PureWebColor result)
 
Constructors and Destructors
static PureWebColor ()
 

Properties

byte A [get]
 
byte B [get]
 
byte G [get]
 
byte R [get]
 

Usage Description

override bool Equals ( object  obj)
inline

Determines whether the specified object is equal to this instance. Returns true if they are equal; otherwise, returns false.

static PureWebColor FromArgb ( byte  a,
byte  r,
byte  g,
byte  b 
)
inlinestatic

Returns a color from the specified ARGB components.

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

Returns a color from the specified known color.

static PureWebColor FromKnownName ( string  name)
inlinestatic

Returns a color from the specified known color name. Throws ArgumentException if the name is not a known color name.

static PureWebColor FromRgb ( byte  r,
byte  g,
byte  b 
)
inlinestatic

Returns a color from the specified RGB components.

Parameters
rThe red component.
gThe green component.
bThe blue component.
override int GetHashCode ( )
inline

Returns a hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

static implicit operator PureWebColor ( System.Windows.Media.Color  color)
inlinestatic

Converts a color expressed as System.Windows.Media.Color into PureWeb color.

static implicit operator PureWebColor ( System.Drawing.Color  color)
inlinestatic

Converts a color expressed as System.Drawing.Color into a PureWeb color.

static implicit operator System.Drawing.Color ( PureWebColor  color)
inlinestatic

Converts a PureWeb color into a color expressed as System.Drawing.Color.

static implicit operator System.Windows.Media.Color ( PureWebColor  color)
inlinestatic

Converts a PureWeb color into a color expressed as System.Windows.Media.Color.

static bool operator!= ( PureWebColor  left,
PureWebColor  right 
)
inlinestatic

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

static bool operator== ( PureWebColor  left,
PureWebColor  right 
)
inlinestatic

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

int ToAbgr ( )
inline

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.

int ToArgb ( )
inline

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.

override string ToString ( )
inline

Returns this instance of PureWebColor expressed as a string.

static bool TryParse ( string  value,
out PureWebColor  result 
)
inlinestatic

Tries to parse the string into a color.

Property Documentation

byte A
get

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

byte B
get

Returns the blue component of the color.

byte G
get

Returns the green component of the color.

byte R
get

Returns the red component of the color.