C# Class ScreenToGif.Util.ColorExtensions

ファイルを表示 Open project: dbremner/ScreenToGif

Public Methods

Method 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 method

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

ClosestColorHue() public static method

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

ClosestColorRgb() public static method

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

ColorDiff() public static method

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

ColorNum() public static method

public static ColorNum ( Color c ) : float
c Color
return float

ConvertHsvToRgb() public static method

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
return Color

ConvertRgbToHsv() public static method

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
return ScreenToGif.Controls.HsvColor

ConvertRgbToHsv() public static method

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

GenerateHsvSpectrum() public static method

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

GetBrightness() public static method

public static GetBrightness ( this c ) : int
c this
return int

GetBrightness2() public static method

public static GetBrightness2 ( this c ) : double
c this
return double

GetBrightness3() public static method

public static GetBrightness3 ( this color ) : float
color this
return float

GetHue() public static method

public static GetHue ( this color ) : float
color this
return float

GetHueDistance() public static method

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

GetLuminance() public static method

Color brightness as perceived.
public static GetLuminance ( Color c ) : float
c Color The Color
return float

GetSaturation() public static method

public static GetSaturation ( this color ) : float
color this
return float

IsEnoughContrast() public static method

public static IsEnoughContrast ( this color1, Color color2 ) : bool
color1 this
color2 Color
return bool