C# Class CUE.NET.Helper.ColorHelper

Offers some extensions and helper-methods for color related things.
Show file Open project: DarthAffe/CUE.NET

Public Methods

Method Description
Blend ( this bg, CorsairColor fg ) : CorsairColor

Blends two colors.

ColorFromHSV ( float hue, float saturation, float value, byte alpha = 255 ) : CorsairColor

Creates a CorsairColor object from the respective hsv-float-values in the range [0..1].

CreateColorFromFloat ( float a, float r, float g, float b ) : CorsairColor

Creates a CorsairColor object from the respective rgb-float-values in the range [0..1].

GetFloatA ( this color ) : float

Converts the alpha-value of the CorsairColor to a float value in the range [0..1].

GetFloatB ( this color ) : float

Converts the blue-value of the CorsairColor to a float value in the range [0..1].

GetFloatG ( this color ) : float

Converts the green-value of the CorsairColor to a float value in the range [0..1].

GetFloatR ( this color ) : float

Converts the red-value of the CorsairColor to a float value in the range [0..1].

GetHSVHue ( this color ) : float

Gets the hue-value (HSV-color space) of the color.

GetHSVSaturation ( this color ) : float

Gets the saturation-value (HSV-color space) of the color.

GetHSVValue ( this color ) : float

Gets the value-value (HSV-color space) of the color.

GetIntColorFromFloat ( float f ) : byte

Converts the given float-value to a integer-color in the range [0..255].

Method Details

Blend() public static method

Blends two colors.
public static Blend ( this bg, CorsairColor fg ) : CorsairColor
bg this The background-color.
fg CUE.NET.Devices.Generic.CorsairColor The foreground-color
return CUE.NET.Devices.Generic.CorsairColor

ColorFromHSV() public static method

Creates a CorsairColor object from the respective hsv-float-values in the range [0..1].
public static ColorFromHSV ( float hue, float saturation, float value, byte alpha = 255 ) : CorsairColor
hue float The hue of the color.
saturation float The saturation of the color.
value float The value of the color.
alpha byte The alpha of the color.
return CUE.NET.Devices.Generic.CorsairColor

CreateColorFromFloat() public static method

Creates a CorsairColor object from the respective rgb-float-values in the range [0..1].
public static CreateColorFromFloat ( float a, float r, float g, float b ) : CorsairColor
a float The alpha-value in the range [0..1].
r float The red-value in the range [0..1].
g float The green-value in the range [0..1].
b float The blue-value in the range [0..1].
return CUE.NET.Devices.Generic.CorsairColor

GetFloatA() public static method

Converts the alpha-value of the CorsairColor to a float value in the range [0..1].
public static GetFloatA ( this color ) : float
color this The color to take the alpha-value from.
return float

GetFloatB() public static method

Converts the blue-value of the CorsairColor to a float value in the range [0..1].
public static GetFloatB ( this color ) : float
color this The color to take the blue-value from.
return float

GetFloatG() public static method

Converts the green-value of the CorsairColor to a float value in the range [0..1].
public static GetFloatG ( this color ) : float
color this The color to take the green-value from.
return float

GetFloatR() public static method

Converts the red-value of the CorsairColor to a float value in the range [0..1].
public static GetFloatR ( this color ) : float
color this The color to take the red-value from.
return float

GetHSVHue() public static method

Gets the hue-value (HSV-color space) of the color.
public static GetHSVHue ( this color ) : float
color this The color to take the hue from.
return float

GetHSVSaturation() public static method

Gets the saturation-value (HSV-color space) of the color.
public static GetHSVSaturation ( this color ) : float
color this The color to take the saturation from.
return float

GetHSVValue() public static method

Gets the value-value (HSV-color space) of the color.
public static GetHSVValue ( this color ) : float
color this The color to take the value from.
return float

GetIntColorFromFloat() public static method

Converts the given float-value to a integer-color in the range [0..255].
public static GetIntColorFromFloat ( float f ) : byte
f float The float color-value
return byte