Search Framework:
WLColor
Namespace: WealthLab.Core
Parent: Object

Represents a color in a platform-independent way.

Constructors
WLColor
public WLColor()
public WLColor(byte r, byte g, byte b)
public WLColor(byte a, byte r, byte g, byte b)
public WLColor(WLColor c)

WLColor offers constructors that allow you to pass alpha, red, green, and blue color components, or to base an instance on another WLColor instance.



Members
A
public byte A

Contains the alpha component of the color. 0 is fully transparent, while 255 is fully opaque.


B
public byte B

Contains the blue component of the color.


Brighten
public WLColor Brighten(double? min = null)

Returns a brightened version of the color. The option min parameter lets you establish a minimum Brightness value for the returned color.


Brightness
public double Brightness

Returns the brightness of the color, in a range of 0 to 1.


Darken
public WLColor Darken(double? max = null)

Returns a darkened version of the color. The option max parameter lets you establish a maximum Brightness value for the returned color.


G
public byte G

Contains the green component of the color.


R
public byte R

Contains the red component of the color.


SetAlpha
public WLColor SetAlpha(byte a)

Returns a version of the color with a modified alpha (A property.)



Static Methods
Parse
public static WLColor Parse(string s)

Returns a WLColor instance based on the string s, which is formatted in the same manner as WLColor's ToString method.


Static "From" Methods
public static WLColor FromArgb(byte a, byte r, byte g, byte b)
public static WLColor FromArgb(byte a, WLColor baseColor)
public static WLColor FromRgb(byte r, byte g, byte b)

These static methods were introduced to preserve compatibility with System.Drawing.Color.