C# Class HFTColorUtils

Afficher le fichier Open project: greggman/hft-unity-gamepad Class Usage Examples

Méthodes publiques

Méthode Description
ColorToHSVA ( Color c ) : Vector4

Converts an RGBA color value to HSVA. Conversion formula adapted from http://en.wikipedia.org/wiki/HSV_color_space. Assumes r, g, and b are contained in the set [0, 1] and returns h, s, and v in the set [0, 1].

Fract ( float v ) : float
HSVAToColor ( Vector4 hsva ) : Color

Converts a HSVA color to a RGBA Color adapted from http://en.wikipedia.org/wiki/HSV_color_space. Assumes h, s, and v are contained in the set [0, 1] and returns r, g, and b in the set [0, 1].

Max ( Color c ) : float
Min ( Color c ) : float
MinMax ( float v, float min, float max ) : float
Saturate ( float v ) : float

Method Details

ColorToHSVA() public static méthode

Converts an RGBA color value to HSVA. Conversion formula adapted from http://en.wikipedia.org/wiki/HSV_color_space. Assumes r, g, and b are contained in the set [0, 1] and returns h, s, and v in the set [0, 1].
public static ColorToHSVA ( Color c ) : Vector4
c Color Color to convert
Résultat Vector4

Fract() public static méthode

public static Fract ( float v ) : float
v float
Résultat float

HSVAToColor() public static méthode

Converts a HSVA color to a RGBA Color adapted from http://en.wikipedia.org/wiki/HSV_color_space. Assumes h, s, and v are contained in the set [0, 1] and returns r, g, and b in the set [0, 1].
public static HSVAToColor ( Vector4 hsva ) : Color
hsva Vector4 Vector4 with h, s, v, a
Résultat Color

Max() public static méthode

public static Max ( Color c ) : float
c Color
Résultat float

Min() public static méthode

public static Min ( Color c ) : float
c Color
Résultat float

MinMax() public static méthode

public static MinMax ( float v, float min, float max ) : float
v float
min float
max float
Résultat float

Saturate() public static méthode

public static Saturate ( float v ) : float
v float
Résultat float