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

Provides methods to convert from a color space to an other.
Mostrar archivo Open project: nohal/RleEditor

Public Methods

Method 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

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

Converts CMYK to RGB.
public static CMYKtoColor ( CMYK cmyk ) : Color
cmyk CMYK
return Color

CMYKtoColor() public static method

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

CMYKtoColor() public static method

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

CMYKtoHSB() public static method

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

CMYKtoHSL() public static method

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

CMYKtoRGB() public static method

Converts CMYK to RGB.
public static CMYKtoRGB ( CMYK cmyk ) : RGB
cmyk CMYK
return RGB

CMYKtoRGB() public static method

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).
return RGB

CMYKtoYUV() public static method

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

GetColorDistance() public static method

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

GetColorDistance() public static method

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]
return double

GetColorDistance() public static method

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.
return double

GetSpectrumColors() public static method

Gets visible spectrum colors.
public static GetSpectrumColors ( ) : Color[]
return Color[]

GetSpectrumColors() public static method

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

GetWheelColors() public static method

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

HSBtoCMYK() public static method

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

HSBtoColor() public static method

Converts HSB to Color.
public static HSBtoColor ( HSB hsb ) : Color
hsb HSB
return Color

HSBtoColor() public static method

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

HSBtoColor() public static method

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

HSBtoHSL() public static method

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

HSBtoRGB() public static method

Converts HSB to RGB.
public static HSBtoRGB ( HSB hsb ) : RGB
hsb HSB
return RGB

HSBtoRGB() public static method

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

HSBtoYUV() public static method

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

HSLtoCMYK() public static method

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

HSLtoColor() public static method

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

HSLtoColor() public static method

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

HSLtoHSB() public static method

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

HSLtoRGB() public static method

Converts HSL to RGB.
public static HSLtoRGB ( HSL hsl ) : RGB
hsl HSL The HSL structure to convert.
return RGB

HSLtoRGB() public static method

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].
return RGB

HSLtoYUV() public static method

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

HexToColor() public static method

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

LabtoRGB() public static method

Converts CIELab to RGB.
public static LabtoRGB ( CIELab lab ) : RGB
lab CIELab
return RGB

LabtoRGB() public static method

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

LabtoXYZ() public static method

Converts CIELab to CIEXYZ.
public static LabtoXYZ ( CIELab lab ) : CIEXYZ
lab CIELab
return CIEXYZ

LabtoXYZ() public static method

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

RGBToHex() public static method

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

RGBToHex() public static method

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.
return string

RGBtoCMYK() public static method

Converts RGB to CMYK
public static RGBtoCMYK ( Color c ) : CMYK
c Color
return CMYK

RGBtoCMYK() public static method

Converts RGB to CMYK
public static RGBtoCMYK ( RGB rgb ) : CMYK
rgb RGB
return CMYK

RGBtoCMYK() public static method

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].
return CMYK

RGBtoHSB() public static method

Converts RGB to HSB.
public static RGBtoHSB ( Color c ) : HSB
c Color
return HSB

RGBtoHSB() public static method

Converts RGB to HSB.
public static RGBtoHSB ( RGB rgb ) : HSB
rgb RGB
return HSB

RGBtoHSB() public static method

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

RGBtoHSL() public static method

Converts Color to HSL.
public static RGBtoHSL ( Color c ) : HSL
c Color
return HSL

RGBtoHSL() public static method

Converts RGB to HSL.
public static RGBtoHSL ( RGB rgb ) : HSL
rgb RGB
return HSL

RGBtoHSL() public static method

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].
return HSL

RGBtoLab() public static method

Converts RGB to CIELab.
public static RGBtoLab ( RGB rgb ) : CIELab
rgb RGB
return CIELab

RGBtoLab() public static method

Converts RGB to CIELab.
public static RGBtoLab ( System color ) : CIELab
color System
return CIELab

RGBtoLab() public static method

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

RGBtoXYZ() public static method

Converts RGB to CIEXYZ.
public static RGBtoXYZ ( Color c ) : CIEXYZ
c Color
return CIEXYZ

RGBtoXYZ() public static method

Converts RGB to CIEXYZ.
public static RGBtoXYZ ( RGB rgb ) : CIEXYZ
rgb RGB
return CIEXYZ

RGBtoXYZ() public static method

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].
return CIEXYZ

RGBtoYUV() public static method

Converts RGB to YUV.
public static RGBtoYUV ( Color c ) : YUV
c Color
return YUV

RGBtoYUV() public static method

Converts RGB to YUV.
public static RGBtoYUV ( RGB rgb ) : YUV
rgb RGB
return YUV

RGBtoYUV() public static method

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].
return YUV

XYZtoLab() public static method

Converts CIEXYZ to CIELab structure.
public static XYZtoLab ( CIEXYZ xyz ) : CIELab
xyz CIEXYZ
return CIELab

XYZtoLab() public static method

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

XYZtoRGB() public static method

Converts CIEXYZ to RGB structure.
public static XYZtoRGB ( CIEXYZ xyz ) : RGB
xyz CIEXYZ
return RGB

XYZtoRGB() public static method

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

XYZtoYxy() public static method

Converts CIEXYZ to CIEYxy structure.
public static XYZtoYxy ( CIEXYZ xyz ) : CIEYxy
xyz CIEXYZ
return CIEYxy

XYZtoYxy() public static method

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

YUVtoCMYK() public static method

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].
return CMYK

YUVtoColor() public static method

Converts YUV to a .net Color.
public static YUVtoColor ( YUV yuv ) : Color
yuv YUV
return Color

YUVtoColor() public static method

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

YUVtoHSB() public static method

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].
return HSB

YUVtoHSL() public static method

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].
return HSL

YUVtoRGB() public static method

Converts YUV to RGB.
public static YUVtoRGB ( YUV yuv ) : RGB
yuv YUV
return RGB

YUVtoRGB() public static method

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].
return RGB

YxytoXYZ() public static method

Converts CIEYxy to CIEXYZ structure.
public static YxytoXYZ ( CIEYxy Yxy ) : CIEXYZ
Yxy CIEYxy
return CIEXYZ

YxytoXYZ() public static method

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