API documentation, members, signatures, and C# examples.
Search the framework
Find classes, members, and documentation.
NamespaceWealthLab.Core
Parent
Object
The WLColor class represents a color in a platform-independent way.
A WLColor consists of alpha, red, green, and blue components, each represented by a byte from 0 to 255. WealthLab uses WLColor throughout its API wherever a color needs to be specified without depending on a platform-specific color implementation.
The original WLColor is not modified.
WLColor provides static properties for a comprehensive set of standard named colors.
For example:
These return fully opaque WLColor instances using the predefined RGB values.
In the current implementation, Transparent and Empty therefore contain identical ARGB component values.
WLColor also provides a set of predefined Neon colors:
The parameterless constructor creates a WLColor whose component values are initially zero.
The three-component constructor creates an opaque color from the specified red, green, and blue values. A is set to 255.
The four-component constructor creates a color using the specified alpha, red, green, and blue values.
The copy constructor creates a new WLColor containing the same ARGB component values as c.
Returns a new, brighter version of the color.
Each RGB component is increased by 20, up to a maximum of 255. The original alpha component is retained.
If min is supplied, WealthLab continues brightening the result until its Brightness reaches at least the specified value, or until the method has made its maximum number of additional attempts.
The original WLColor is not modified.
Returns the perceived brightness of the color as a value approximately ranging from 0.0 for black to 1.0 for white.
Brightness is calculated using weighted RGB components:
Returns a new, darker version of the color.
Each RGB component is multiplied by 0.8. The original alpha component is retained.
If max is supplied, WealthLab continues darkening the result until its Brightness is no greater than the specified value, or until the method has made its maximum number of additional attempts.
The original WLColor is not modified.
Compares two WLColor instances by their ARGB component values.
Two WLColor instances are considered equal when their A, R, G, and B properties are equal.
The operators also correctly handle null references.
Creates a WLColor from ARGB component values.
The second overload uses the red, green, and blue components of baseColor while replacing its alpha component with a.
These methods provide an API similar to the corresponding System.Drawing.Color methods.