C# Class Cubia.Color

A color, as stolen from one of my previous projects. Represents a color including alpha. Contains methods for color manipulation.
Mostra file Open project: dzamkov/MineViewer Class Usage Examples

Public Properties

Property Type Description
A double
B double
G double
R double

Public Methods

Method Description
HLSA ( double H, double L, double S, double A ) : Color

Creates a color from its HLSA representation.

Mix ( Color A, Color B, double Amount ) : Color

Mixes two colors based on the specified amount. If the amount is 0.0, the resulting color will be A. If the amount is 1.0, the resulting color will be B. Values in between will cause the color to be interpolated.

RGB ( double R, double G, double B ) : Color

Creates a color from its RGB reprsentation with a completely opaque alpha.

RGBA ( double R, double G, double B, double A ) : Color

Creates a color from its RGBA representation. Values should be between 0.0 and 1.0.

Method Details

HLSA() public static method

Creates a color from its HLSA representation.
public static HLSA ( double H, double L, double S, double A ) : Color
H double Hue in degrees.
L double Lumination between 0.0 and 1.0.
S double Saturation between 0.0 and 1.0.
A double Alpha between 0.0 and 1.0.
return Color

Mix() public static method

Mixes two colors based on the specified amount. If the amount is 0.0, the resulting color will be A. If the amount is 1.0, the resulting color will be B. Values in between will cause the color to be interpolated.
public static Mix ( Color A, Color B, double Amount ) : Color
A Color
B Color
Amount double
return Color

RGB() public static method

Creates a color from its RGB reprsentation with a completely opaque alpha.
public static RGB ( double R, double G, double B ) : Color
R double
G double
B double
return Color

RGBA() public static method

Creates a color from its RGBA representation. Values should be between 0.0 and 1.0.
public static RGBA ( double R, double G, double B, double A ) : Color
R double
G double
B double
A double
return Color

Property Details

A public_oe property

public double A
return double

B public_oe property

public double B
return double

G public_oe property

public double G
return double

R public_oe property

public double R
return double