C# Class ScreenToGif.Util.ColorExtensions

Afficher le fichier Open project: dbremner/ScreenToGif

Méthodes publiques

Méthode Description
ClosestColorHsb ( List colors, Color target ) : int

Weighed distance using hue, saturation and brightness.

ClosestColorHue ( List colors, Color target ) : int

Closest match for hues only.

ClosestColorRgb ( List colors, Color target ) : int

Closest match in RGB space.

ColorDiff ( Color c1, Color c2 ) : int

Gets the distance in the RGB space.

ColorNum ( Color c ) : float
ConvertHsvToRgb ( double h, double s, double v, double alpha ) : Color

Converts an HSV color to an RGB color.

ConvertRgbToHsv ( int r, int b, int g ) : HsvColor

Converts an RGB color to an HSV color

ConvertRgbToHsv ( this color ) : HsvColor

Converts an RGB color to an HSV color

GenerateHsvSpectrum ( ) : List

Generates a list of colors with hues ranging from 0-360 and a saturation and value of 1.

GetBrightness ( this c ) : int
GetBrightness2 ( this c ) : double
GetBrightness3 ( this color ) : float
GetHue ( this color ) : float
GetHueDistance ( float hue1, float hue2 ) : float

Gets the distance between two hues.

GetLuminance ( Color c ) : float

Color brightness as perceived.

GetSaturation ( this color ) : float
IsEnoughContrast ( this color1, Color color2 ) : bool

Method Details

ClosestColorHsb() public static méthode

Weighed distance using hue, saturation and brightness.
public static ClosestColorHsb ( List colors, Color target ) : int
colors List
target Color
Résultat int

ClosestColorHue() public static méthode

Closest match for hues only.
public static ClosestColorHue ( List colors, Color target ) : int
colors List
target Color
Résultat int

ClosestColorRgb() public static méthode

Closest match in RGB space.
public static ClosestColorRgb ( List colors, Color target ) : int
colors List
target Color
Résultat int

ColorDiff() public static méthode

Gets the distance in the RGB space.
public static ColorDiff ( Color c1, Color c2 ) : int
c1 Color Color 1
c2 Color Color 2
Résultat int

ColorNum() public static méthode

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

ConvertHsvToRgb() public static méthode

Converts an HSV color to an RGB color.
public static ConvertHsvToRgb ( double h, double s, double v, double alpha ) : Color
h double Hue
s double Saturation
v double Value
alpha double Alpha
Résultat Color

ConvertRgbToHsv() public static méthode

Converts an RGB color to an HSV color
public static ConvertRgbToHsv ( int r, int b, int g ) : HsvColor
r int Red
b int Blue
g int Green
Résultat ScreenToGif.Controls.HsvColor

ConvertRgbToHsv() public static méthode

Converts an RGB color to an HSV color
public static ConvertRgbToHsv ( this color ) : HsvColor
color this Color
Résultat ScreenToGif.Controls.HsvColor

GenerateHsvSpectrum() public static méthode

Generates a list of colors with hues ranging from 0-360 and a saturation and value of 1.
public static GenerateHsvSpectrum ( ) : List
Résultat List

GetBrightness() public static méthode

public static GetBrightness ( this c ) : int
c this
Résultat int

GetBrightness2() public static méthode

public static GetBrightness2 ( this c ) : double
c this
Résultat double

GetBrightness3() public static méthode

public static GetBrightness3 ( this color ) : float
color this
Résultat float

GetHue() public static méthode

public static GetHue ( this color ) : float
color this
Résultat float

GetHueDistance() public static méthode

Gets the distance between two hues.
public static GetHueDistance ( float hue1, float hue2 ) : float
hue1 float Hue 1
hue2 float Hue 2
Résultat float

GetLuminance() public static méthode

Color brightness as perceived.
public static GetLuminance ( Color c ) : float
c Color The Color
Résultat float

GetSaturation() public static méthode

public static GetSaturation ( this color ) : float
color this
Résultat float

IsEnoughContrast() public static méthode

public static IsEnoughContrast ( this color1, Color color2 ) : bool
color1 this
color2 Color
Résultat bool