C# Class Nohal.RleEditor.RleParser.Utils.ColorSpaceHelper

Provides methods to convert from a color space to an other.
Afficher le fichier Open project: nohal/RleEditor

Méthodes publiques

Méthode Description
CMYKtoColor ( CMYK cmyk ) : Color

Converts CMYK to RGB.

CMYKtoColor ( double c, double m, double y, double k ) : Color

Converts CMYK to RGB.

CMYKtoColor ( float c, float m, float y, float k ) : Color

Converts CMYK to RGB.

CMYKtoHSB ( double c, double m, double y, double k ) : HSB

Converts CMYK to HSB.

CMYKtoHSL ( double c, double m, double y, double k ) : HSL

Converts CMYK to HSL.

CMYKtoRGB ( CMYK cmyk ) : RGB

Converts CMYK to RGB.

CMYKtoRGB ( double c, double m, double y, double k ) : RGB

Converts CMYK to RGB.

CMYKtoYUV ( double c, double m, double y, double k ) : YUV

Converts CMYK to YUV.

GetColorDistance ( Color c1, Color c2 ) : double

Gets the "distance" between two colors.

GetColorDistance ( double color1, double color2 ) : double

Gets the "distance" between two colors. RGB colors must be normalized (eg. values in [0.0, 1.0]).

GetColorDistance ( double r1, double g1, double b1, double r2, double g2, double b2 ) : double

Gets the "distance" between two colors. RGB colors must be normalized (eg. values in [0.0, 1.0]).

GetSpectrumColors ( ) : Color[]

Gets visible spectrum colors.

GetSpectrumColors ( int alpha ) : Color[]

Gets visible spectrum colors.

GetWheelColors ( int alpha ) : Color[]

Gets visible colors (color wheel).

HSBtoCMYK ( double h, double s, double b ) : CMYK

Converts HSB to CMYK.

HSBtoColor ( HSB hsb ) : Color

Converts HSB to Color.

HSBtoColor ( double h, double s, double b ) : Color

Converts HSB to a .net Color.

HSBtoColor ( int h, int s, int b ) : Color

Converts HSB to Color.

HSBtoHSL ( double h, double s, double b ) : HSL

Converts HSB to HSL.

HSBtoRGB ( HSB hsb ) : RGB

Converts HSB to RGB.

HSBtoRGB ( double h, double s, double b ) : RGB

Converts HSB to RGB.

HSBtoYUV ( double h, double s, double b ) : YUV

Converts HSB to CMYK.

HSLtoCMYK ( double h, double s, double l ) : CMYK

Converts HSL to CMYK.

HSLtoColor ( HSL hsl ) : Color

Converts HSL to .net Color.

HSLtoColor ( double h, double s, double l ) : Color

Converts HSL to .net Color.

HSLtoHSB ( double h, double s, double l ) : HSB

Converts HSL to HSB.

HSLtoRGB ( HSL hsl ) : RGB

Converts HSL to RGB.

HSLtoRGB ( double h, double s, double l ) : RGB

Converts HSL to RGB.

HSLtoYUV ( double h, double s, double l ) : YUV

Converts HSL to YUV.

HexToColor ( string hexColor ) : Color

Converts a Hex color to a .net Color.

LabtoRGB ( CIELab lab ) : RGB

Converts CIELab to RGB.

LabtoRGB ( double l, double a, double b ) : RGB

Converts CIELab to RGB.

LabtoXYZ ( CIELab lab ) : CIEXYZ

Converts CIELab to CIEXYZ.

LabtoXYZ ( double l, double a, double b ) : CIEXYZ

Converts CIELab to CIEXYZ.

RGBToHex ( Color c ) : string

Converts a RGB color format to an hexadecimal color.

RGBToHex ( int r, int g, int b ) : string

Converts a RGB color format to an hexadecimal color.

RGBtoCMYK ( Color c ) : CMYK

Converts RGB to CMYK

RGBtoCMYK ( RGB rgb ) : CMYK

Converts RGB to CMYK

RGBtoCMYK ( int red, int green, int blue ) : CMYK

Converts RGB to CMYK

RGBtoHSB ( Color c ) : HSB

Converts RGB to HSB.

RGBtoHSB ( RGB rgb ) : HSB

Converts RGB to HSB.

RGBtoHSB ( int red, int green, int blue ) : HSB

Converts RGB to HSB.

RGBtoHSL ( Color c ) : HSL

Converts Color to HSL.

RGBtoHSL ( RGB rgb ) : HSL

Converts RGB to HSL.

RGBtoHSL ( int red, int green, int blue ) : HSL

Converts RGB to HSL.

RGBtoLab ( RGB rgb ) : CIELab

Converts RGB to CIELab.

RGBtoLab ( System color ) : CIELab

Converts RGB to CIELab.

RGBtoLab ( int red, int green, int blue ) : CIELab

Converts RGB to CIELab.

RGBtoXYZ ( Color c ) : CIEXYZ

Converts RGB to CIEXYZ.

RGBtoXYZ ( RGB rgb ) : CIEXYZ

Converts RGB to CIEXYZ.

RGBtoXYZ ( int red, int green, int blue ) : CIEXYZ

Converts RGB to CIE XYZ (CIE 1931 color space)

RGBtoYUV ( Color c ) : YUV

Converts RGB to YUV.

RGBtoYUV ( RGB rgb ) : YUV

Converts RGB to YUV.

RGBtoYUV ( int red, int green, int blue ) : YUV

Converts RGB to YUV.

XYZtoLab ( CIEXYZ xyz ) : CIELab

Converts CIEXYZ to CIELab structure.

XYZtoLab ( double x, double y, double z ) : CIELab

Converts CIEXYZ to CIELab structure.

XYZtoRGB ( CIEXYZ xyz ) : RGB

Converts CIEXYZ to RGB structure.

XYZtoRGB ( double x, double y, double z ) : RGB

Converts CIEXYZ to RGB structure.

XYZtoYxy ( CIEXYZ xyz ) : CIEYxy

Converts CIEXYZ to CIEYxy structure.

XYZtoYxy ( double x, double y, double z ) : CIEYxy

Converts CIEXYZ to CIEYxy structure.

YUVtoCMYK ( double y, double u, double v ) : CMYK

Converts YUV to CMYK.

YUVtoColor ( YUV yuv ) : Color

Converts YUV to a .net Color.

YUVtoColor ( double y, double u, double v ) : Color

Converts YUV to a .net Color.

YUVtoHSB ( double y, double u, double v ) : HSB

Converts YUV to HSB.

YUVtoHSL ( double y, double u, double v ) : HSL

Converts YUV to HSL.

YUVtoRGB ( YUV yuv ) : RGB

Converts YUV to RGB.

YUVtoRGB ( double y, double u, double v ) : RGB

Converts YUV to RGB.

YxytoXYZ ( CIEYxy Yxy ) : CIEXYZ

Converts CIEYxy to CIEXYZ structure.

YxytoXYZ ( double Y, double x, double y ) : CIEXYZ

Converts CIEYxy to CIEXYZ structure.

Private Methods

Méthode Description
ColorSpaceHelper ( ) : System
Fxyz ( double t ) : double

XYZ to L*a*b* transformation function.

GetIntFromHex ( string strHex ) : int

Gets the int equivalent for a hexadecimal value.

Method Details

CMYKtoColor() public static méthode

Converts CMYK to RGB.
public static CMYKtoColor ( CMYK cmyk ) : Color
cmyk CMYK
Résultat Color

CMYKtoColor() public static méthode

Converts CMYK to RGB.
public static CMYKtoColor ( double c, double m, double y, double k ) : Color
c double Cyan value (must be between 0 and 1).
m double Magenta value (must be between 0 and 1).
y double Yellow value (must be between 0 and 1).
k double Black value (must be between 0 and 1).
Résultat Color

CMYKtoColor() public static méthode

Converts CMYK to RGB.
public static CMYKtoColor ( float c, float m, float y, float k ) : Color
c float Cyan value (must be between 0 and 1).
m float Magenta value (must be between 0 and 1).
y float Yellow value (must be between 0 and 1).
k float Black value (must be between 0 and 1).
Résultat Color

CMYKtoHSB() public static méthode

Converts CMYK to HSB.
public static CMYKtoHSB ( double c, double m, double y, double k ) : HSB
c double
m double
y double
k double
Résultat HSB

CMYKtoHSL() public static méthode

Converts CMYK to HSL.
public static CMYKtoHSL ( double c, double m, double y, double k ) : HSL
c double
m double
y double
k double
Résultat HSL

CMYKtoRGB() public static méthode

Converts CMYK to RGB.
public static CMYKtoRGB ( CMYK cmyk ) : RGB
cmyk CMYK
Résultat RGB

CMYKtoRGB() public static méthode

Converts CMYK to RGB.
public static CMYKtoRGB ( double c, double m, double y, double k ) : RGB
c double Cyan value (must be between 0 and 1).
m double Magenta value (must be between 0 and 1).
y double Yellow value (must be between 0 and 1).
k double Black value (must be between 0 and 1).
Résultat RGB

CMYKtoYUV() public static méthode

Converts CMYK to YUV.
public static CMYKtoYUV ( double c, double m, double y, double k ) : YUV
c double
m double
y double
k double
Résultat YUV

GetColorDistance() public static méthode

Gets the "distance" between two colors.
public static GetColorDistance ( Color c1, Color c2 ) : double
c1 Color
c2 Color
Résultat double

GetColorDistance() public static méthode

Gets the "distance" between two colors. RGB colors must be normalized (eg. values in [0.0, 1.0]).
public static GetColorDistance ( double color1, double color2 ) : double
color1 double First color [r,g,b]
color2 double Second color [r,g,b]
Résultat double

GetColorDistance() public static méthode

Gets the "distance" between two colors. RGB colors must be normalized (eg. values in [0.0, 1.0]).
public static GetColorDistance ( double r1, double g1, double b1, double r2, double g2, double b2 ) : double
r1 double First color red component.
g1 double First color green component.
b1 double First color blue component.
r2 double Second color red component.
g2 double Second color green component.
b2 double Second color blue component.
Résultat double

GetSpectrumColors() public static méthode

Gets visible spectrum colors.
public static GetSpectrumColors ( ) : Color[]
Résultat Color[]

GetSpectrumColors() public static méthode

Gets visible spectrum colors.
public static GetSpectrumColors ( int alpha ) : Color[]
alpha int The alpha value used for each colors.
Résultat Color[]

GetWheelColors() public static méthode

Gets visible colors (color wheel).
public static GetWheelColors ( int alpha ) : Color[]
alpha int /// The alpha value used for each colors. ///
Résultat Color[]

HSBtoCMYK() public static méthode

Converts HSB to CMYK.
public static HSBtoCMYK ( double h, double s, double b ) : CMYK
h double
s double
b double
Résultat CMYK

HSBtoColor() public static méthode

Converts HSB to Color.
public static HSBtoColor ( HSB hsb ) : Color
hsb HSB
Résultat Color

HSBtoColor() public static méthode

Converts HSB to a .net Color.
public static HSBtoColor ( double h, double s, double b ) : Color
h double Hue value (must be between 0 and 360).
s double Saturation value (must be between 0 and 1).
b double Brightness value (must be between 0 and 1).
Résultat Color

HSBtoColor() public static méthode

Converts HSB to Color.
public static HSBtoColor ( int h, int s, int b ) : Color
h int Hue value.
s int Saturation value.
b int Brightness value.
Résultat Color

HSBtoHSL() public static méthode

Converts HSB to HSL.
public static HSBtoHSL ( double h, double s, double b ) : HSL
h double
s double
b double
Résultat HSL

HSBtoRGB() public static méthode

Converts HSB to RGB.
public static HSBtoRGB ( HSB hsb ) : RGB
hsb HSB
Résultat RGB

HSBtoRGB() public static méthode

Converts HSB to RGB.
public static HSBtoRGB ( double h, double s, double b ) : RGB
h double
s double
b double
Résultat RGB

HSBtoYUV() public static méthode

Converts HSB to CMYK.
public static HSBtoYUV ( double h, double s, double b ) : YUV
h double
s double
b double
Résultat YUV

HSLtoCMYK() public static méthode

Converts HSL to CMYK.
public static HSLtoCMYK ( double h, double s, double l ) : CMYK
h double
s double
l double
Résultat CMYK

HSLtoColor() public static méthode

Converts HSL to .net Color.
public static HSLtoColor ( HSL hsl ) : Color
hsl HSL The HSL structure to convert.
Résultat Color

HSLtoColor() public static méthode

Converts HSL to .net Color.
public static HSLtoColor ( double h, double s, double l ) : Color
h double
s double
l double
Résultat Color

HSLtoHSB() public static méthode

Converts HSL to HSB.
public static HSLtoHSB ( double h, double s, double l ) : HSB
h double
s double
l double
Résultat HSB

HSLtoRGB() public static méthode

Converts HSL to RGB.
public static HSLtoRGB ( HSL hsl ) : RGB
hsl HSL The HSL structure to convert.
Résultat RGB

HSLtoRGB() public static méthode

Converts HSL to RGB.
public static HSLtoRGB ( double h, double s, double l ) : RGB
h double Hue, must be in [0, 360].
s double Saturation, must be in [0, 1].
l double Luminance, must be in [0, 1].
Résultat RGB

HSLtoYUV() public static méthode

Converts HSL to YUV.
public static HSLtoYUV ( double h, double s, double l ) : YUV
h double
s double
l double
Résultat YUV

HexToColor() public static méthode

Converts a Hex color to a .net Color.
public static HexToColor ( string hexColor ) : Color
hexColor string The desired hexadecimal color to convert.
Résultat Color

LabtoRGB() public static méthode

Converts CIELab to RGB.
public static LabtoRGB ( CIELab lab ) : RGB
lab CIELab
Résultat RGB

LabtoRGB() public static méthode

Converts CIELab to RGB.
public static LabtoRGB ( double l, double a, double b ) : RGB
l double
a double
b double
Résultat RGB

LabtoXYZ() public static méthode

Converts CIELab to CIEXYZ.
public static LabtoXYZ ( CIELab lab ) : CIEXYZ
lab CIELab
Résultat CIEXYZ

LabtoXYZ() public static méthode

Converts CIELab to CIEXYZ.
public static LabtoXYZ ( double l, double a, double b ) : CIEXYZ
l double
a double
b double
Résultat CIEXYZ

RGBToHex() public static méthode

Converts a RGB color format to an hexadecimal color.
public static RGBToHex ( Color c ) : string
c Color
Résultat string

RGBToHex() public static méthode

Converts a RGB color format to an hexadecimal color.
public static RGBToHex ( int r, int g, int b ) : string
r int The Red value.
g int The Green value.
b int The Blue value.
Résultat string

RGBtoCMYK() public static méthode

Converts RGB to CMYK
public static RGBtoCMYK ( Color c ) : CMYK
c Color
Résultat CMYK

RGBtoCMYK() public static méthode

Converts RGB to CMYK
public static RGBtoCMYK ( RGB rgb ) : CMYK
rgb RGB
Résultat CMYK

RGBtoCMYK() public static méthode

Converts RGB to CMYK
public static RGBtoCMYK ( int red, int green, int blue ) : CMYK
red int Red vaue must be in [0, 255].
green int Green vaue must be in [0, 255].
blue int Blue vaue must be in [0, 255].
Résultat CMYK

RGBtoHSB() public static méthode

Converts RGB to HSB.
public static RGBtoHSB ( Color c ) : HSB
c Color
Résultat HSB

RGBtoHSB() public static méthode

Converts RGB to HSB.
public static RGBtoHSB ( RGB rgb ) : HSB
rgb RGB
Résultat HSB

RGBtoHSB() public static méthode

Converts RGB to HSB.
public static RGBtoHSB ( int red, int green, int blue ) : HSB
red int
green int
blue int
Résultat HSB

RGBtoHSL() public static méthode

Converts Color to HSL.
public static RGBtoHSL ( Color c ) : HSL
c Color
Résultat HSL

RGBtoHSL() public static méthode

Converts RGB to HSL.
public static RGBtoHSL ( RGB rgb ) : HSL
rgb RGB
Résultat HSL

RGBtoHSL() public static méthode

Converts RGB to HSL.
public static RGBtoHSL ( int red, int green, int blue ) : HSL
red int Red value, must be in [0,255].
green int Green value, must be in [0,255].
blue int Blue value, must be in [0,255].
Résultat HSL

RGBtoLab() public static méthode

Converts RGB to CIELab.
public static RGBtoLab ( RGB rgb ) : CIELab
rgb RGB
Résultat CIELab

RGBtoLab() public static méthode

Converts RGB to CIELab.
public static RGBtoLab ( System color ) : CIELab
color System
Résultat CIELab

RGBtoLab() public static méthode

Converts RGB to CIELab.
public static RGBtoLab ( int red, int green, int blue ) : CIELab
red int
green int
blue int
Résultat CIELab

RGBtoXYZ() public static méthode

Converts RGB to CIEXYZ.
public static RGBtoXYZ ( Color c ) : CIEXYZ
c Color
Résultat CIEXYZ

RGBtoXYZ() public static méthode

Converts RGB to CIEXYZ.
public static RGBtoXYZ ( RGB rgb ) : CIEXYZ
rgb RGB
Résultat CIEXYZ

RGBtoXYZ() public static méthode

Converts RGB to CIE XYZ (CIE 1931 color space)
public static RGBtoXYZ ( int red, int green, int blue ) : CIEXYZ
red int Red must be in [0, 255].
green int Green must be in [0, 255].
blue int Blue must be in [0, 255].
Résultat CIEXYZ

RGBtoYUV() public static méthode

Converts RGB to YUV.
public static RGBtoYUV ( Color c ) : YUV
c Color
Résultat YUV

RGBtoYUV() public static méthode

Converts RGB to YUV.
public static RGBtoYUV ( RGB rgb ) : YUV
rgb RGB
Résultat YUV

RGBtoYUV() public static méthode

Converts RGB to YUV.
public static RGBtoYUV ( int red, int green, int blue ) : YUV
red int red must be in [0, 255].
green int green must be in [0, 255].
blue int blue must be in [0, 255].
Résultat YUV

XYZtoLab() public static méthode

Converts CIEXYZ to CIELab structure.
public static XYZtoLab ( CIEXYZ xyz ) : CIELab
xyz CIEXYZ
Résultat CIELab

XYZtoLab() public static méthode

Converts CIEXYZ to CIELab structure.
public static XYZtoLab ( double x, double y, double z ) : CIELab
x double
y double
z double
Résultat CIELab

XYZtoRGB() public static méthode

Converts CIEXYZ to RGB structure.
public static XYZtoRGB ( CIEXYZ xyz ) : RGB
xyz CIEXYZ
Résultat RGB

XYZtoRGB() public static méthode

Converts CIEXYZ to RGB structure.
public static XYZtoRGB ( double x, double y, double z ) : RGB
x double
y double
z double
Résultat RGB

XYZtoYxy() public static méthode

Converts CIEXYZ to CIEYxy structure.
public static XYZtoYxy ( CIEXYZ xyz ) : CIEYxy
xyz CIEXYZ
Résultat CIEYxy

XYZtoYxy() public static méthode

Converts CIEXYZ to CIEYxy structure.
public static XYZtoYxy ( double x, double y, double z ) : CIEYxy
x double
y double
z double
Résultat CIEYxy

YUVtoCMYK() public static méthode

Converts YUV to CMYK.
public static YUVtoCMYK ( double y, double u, double v ) : CMYK
y double Y must be in [0, 1].
u double U must be in [-0.436, +0.436].
v double V must be in [-0.615, +0.615].
Résultat CMYK

YUVtoColor() public static méthode

Converts YUV to a .net Color.
public static YUVtoColor ( YUV yuv ) : Color
yuv YUV
Résultat Color

YUVtoColor() public static méthode

Converts YUV to a .net Color.
public static YUVtoColor ( double y, double u, double v ) : Color
y double Y must be in [0, 1].
u double U must be in [-0.436, +0.436].
v double V must be in [-0.615, +0.615].
Résultat Color

YUVtoHSB() public static méthode

Converts YUV to HSB.
public static YUVtoHSB ( double y, double u, double v ) : HSB
y double Y must be in [0, 1].
u double U must be in [-0.436, +0.436].
v double V must be in [-0.615, +0.615].
Résultat HSB

YUVtoHSL() public static méthode

Converts YUV to HSL.
public static YUVtoHSL ( double y, double u, double v ) : HSL
y double Y must be in [0, 1].
u double U must be in [-0.436, +0.436].
v double V must be in [-0.615, +0.615].
Résultat HSL

YUVtoRGB() public static méthode

Converts YUV to RGB.
public static YUVtoRGB ( YUV yuv ) : RGB
yuv YUV
Résultat RGB

YUVtoRGB() public static méthode

Converts YUV to RGB.
public static YUVtoRGB ( double y, double u, double v ) : RGB
y double Y must be in [0, 1].
u double U must be in [-0.436, +0.436].
v double V must be in [-0.615, +0.615].
Résultat RGB

YxytoXYZ() public static méthode

Converts CIEYxy to CIEXYZ structure.
public static YxytoXYZ ( CIEYxy Yxy ) : CIEXYZ
Yxy CIEYxy
Résultat CIEXYZ

YxytoXYZ() public static méthode

Converts CIEYxy to CIEXYZ structure.
public static YxytoXYZ ( double Y, double x, double y ) : CIEXYZ
Y double
x double
y double
Résultat CIEXYZ