private Color CreateInstance() { var sctor = ColorspaceDropDown.Items[ColorspaceDropDown.SelectedIndex] as ListItem; ConstructorInfo ctor = sctor.Tag as ConstructorInfo; switch (sctor.Key) { case "wp": Whitepoint wp = GetWhitepoint(); return(ctor.Invoke(new object[] { wp }) as Color); case "rgb": ColorspaceRGB rgbspace = GetRGBColorspace(); return(ctor.Invoke(new object[] { rgbspace }) as Color); case "gray": double gamma = GammaNum.Value; Whitepoint gwp = GetWhitepoint(); var gspace = new ColorspaceGray(gwp, gamma); return(ctor.Invoke(new object[] { gspace }) as Color); case "icc": string iccPath = ICCTextBox.Text; var profile = new ICCProfileReader().Read(iccPath); return(ctor.Invoke(new object[] { profile }) as Color); default: throw new Exception("Invalid Key"); } }
/// <summary> /// Creates a new instance of a BCH Color /// </summary> /// <param name="ReferenceWhite">The reference white</param> /// <param name="B">Brightness (0 - 100)</param> /// <param name="C">Chroma</param> /// <param name="H">Hue (0 - 360)</param> public ColorBCH(Whitepoint ReferenceWhite, double B, double C, double H) : base() { this.wp = ReferenceWhite; this.B = B; this.C = C; this.H = H; }
public TestColorspaceRGB(Whitepoint wp, double[] Cr, double[] Cg, double[] Cb, double Gamma) : base(wp) { _Cr = Cr; _Cg = Cg; _Cb = Cb; _Gamma = Gamma; }
/// <summary> /// Creates a new instance of a Bef Color /// </summary> /// <param name="ReferenceWhite">The reference white</param> /// <param name="B">B-value</param> /// <param name="e">e-value</param> /// <param name="f">f-value</param> public ColorBef(Whitepoint ReferenceWhite, double B, double e, double f) : base() { this.wp = ReferenceWhite; this.B = B; this.e = e; this.f = f; }
/// <summary> /// Creates a new instance of a CIE L*u*v* Color /// </summary> /// <param name="ReferenceWhite">The reference white</param> /// <param name="L">Lightness (0 - 100)</param> /// <param name="u">u-value (red/green)</param> /// <param name="v">v-value (blue/yellow)</param> public ColorLuv(Whitepoint ReferenceWhite, double L, double u, double v) : base() { this.wp = ReferenceWhite; this.L = L; this.u = u; this.v = v; }
/// <summary> /// Creates a new instance of a DEF Color /// </summary> /// <param name="ReferenceWhite">The reference white</param> /// <param name="D">D-value</param> /// <param name="E">E-value</param> /// <param name="F">F-value</param> public ColorDEF(Whitepoint ReferenceWhite, double D, double E, double F) : base() { this.wp = ReferenceWhite; this.D = D; this.E = E; this.F = F; }
/// <summary> /// Creates a new instance of a CIE L*a*b* Color /// </summary> /// <param name="ReferenceWhite">The reference white</param> /// <param name="L">Lightness (0 - 100)</param> /// <param name="a">a-value (green/magenta)</param> /// <param name="b">b-value (blue/yellow)</param> public ColorLab(Whitepoint ReferenceWhite, double L, double a, double b) : base() { this.wp = ReferenceWhite; this.L = L; this.a = a; this.b = b; }
/// <summary> /// Creates a new instance of a CIE Yxy Color /// </summary> /// <param name="ReferenceWhite">The reference white</param> /// <param name="Y">Y-value (0.0 - 1.0)</param> /// <param name="x">x-value</param> /// <param name="y">y-value</param> public ColorYxy(Whitepoint ReferenceWhite, double Y, double x, double y) : base() { this.wp = ReferenceWhite; this.Y = Y; this.x = x; this.y = y; }
/// <summary> /// Creates a new instance of a CIE XYZ Color /// </summary> /// <param name="ReferenceWhite">The reference white</param> /// <param name="X">X-value (0.0 - 1.0)</param> /// <param name="Y">Y-value (0.0 - 1.0)</param> /// <param name="Z">Z-value (0.0 - 1.0)</param> public ColorXYZ(Whitepoint ReferenceWhite, double X, double Y, double Z) : base() { this.wp = ReferenceWhite; this.X = X; this.Y = Y; this.Z = Z; }
/// <summary> /// Creates a new instance of a CIE L*a*b* Color /// </summary> /// <param name="ReferenceWhite">The reference white</param> public ColorLab(Whitepoint ReferenceWhite) : this(ReferenceWhite, 0, 0, 0) { }
/// <summary> /// Creates a new instance of the <see cref="ColorLCHab"/> class /// </summary> /// <param name="wp">The reference white for this color</param> public ColorLCHab(Whitepoint wp) : base(wp) { }
/// <summary> /// Creates a new instance of the <see cref="ColorBef"/> class /// </summary> /// <param name="B">Value for the Brightness channel</param> /// <param name="e">Value for the e channel</param> /// <param name="f">Value for the f channel</param> /// <param name="wp">The reference white for this color</param> public ColorBef(double B, double e, double f, Whitepoint wp) : base(new Colorspace(wp), B, e, f) { }
/// <summary> /// Creates a new instance of a BCH Color /// </summary> /// <param name="ReferenceWhite">The reference white</param> public ColorBCH(Whitepoint ReferenceWhite) : this(ReferenceWhite, 0, 0, 0) { }
/// <summary> /// Creates a new instance of the <see cref="ColorBef"/> class /// </summary> /// <param name="wp">The reference white for this color</param> public ColorBef(Whitepoint wp) : base(new Colorspace(wp), 0, 0, 0) { }
/// <summary> /// Creates a new instance of the <see cref="ColorLCHBase"/> class /// </summary> /// <param name="wp">The reference white for this color</param> protected ColorLCHBase(Whitepoint wp) : base(new Colorspace(wp), 0, 0, 0) { }
/// <summary> /// Creates a new instance of the <see cref="ColorBCH"/> class /// </summary> /// <param name="B">Value for the Brightness channel</param> /// <param name="C">Value for the Chromaticity channel</param> /// <param name="H">Value for the Hue channel</param> /// <param name="wp">The reference white for this color</param> public ColorBCH(double B, double C, double H, Whitepoint wp) : base(new Colorspace(wp), B, C, H) { }
/// <summary> /// Creates a new instance of the <see cref="ColorLCHab"/> class /// </summary> /// <param name="L">Value for the Lightness channel</param> /// <param name="C">Value for the Chroma channel</param> /// <param name="H">Value for the Hue channel</param> /// <param name="wp">The reference white for this color</param> public ColorLCHab(double L, double C, double H, Whitepoint wp) : base(L, C, H, wp) { }
/// <summary> /// Creates a new instance of the <see cref="ColorLCHBase"/> class /// </summary> /// <param name="L">Value for the Lightness channel</param> /// <param name="C">Value for the Chroma channel</param> /// <param name="H">Value for the Hue channel</param> /// <param name="wp">The reference white for this color</param> protected ColorLCHBase(double L, double C, double H, Whitepoint wp) : base(new Colorspace(wp), L, C, H) { }
/// <summary> /// Creates a new instance of the <see cref="ColorDEF"/> class /// </summary> /// <param name="D">Value for the D channel</param> /// <param name="E">Value for the E channel</param> /// <param name="F">Value for the F channel</param> /// <param name="wp">The reference white for this color</param> public ColorDEF(double D, double E, double F, Whitepoint wp) : base(new Colorspace(wp), D, E, F) { }