예제 #1
0
 public void XYZvalueChanged()
 {
     xyz = new Xyz {
         X = XC.Value, Y = Y2C.Value, Z = ZC.Value
     };
     rgb           = xyz.To <Rgb>();
     BOX.BackColor = Color.FromArgb(alpha, (int)rgb.R, (int)rgb.G, (int)rgb.B);
     xl.Text       = string.Format("X({0:F2})", xyz.X);
     y2l.Text      = string.Format("Y({0:F2})", xyz.Y);
     zl.Text       = string.Format("Z({0:F2})", xyz.Z);
     XC.Value      = (int)xyz.X;
     Y2C.Value     = (int)xyz.Y;
     ZC.Value      = (int)xyz.Z;
 }
예제 #2
0
        public void CMYvalueChanged()
        {
            double multiplier = SS.Maximum;

            cmy = new Cmy {
                C = CS.Value / multiplier, M = MS.Value / multiplier, Y = YS.Value / multiplier
            };
            rgb           = cmy.To <Rgb>();
            BOX.BackColor = Color.FromArgb(alpha, (int)rgb.R, (int)rgb.G, (int)rgb.B);
            cl.Text       = string.Format("C({0:F2})", cmy.C);
            ml.Text       = string.Format("M({0:F2})", cmy.M);
            yl.Text       = string.Format("Y({0:F2})", cmy.Y);
            CS.Value      = (int)(cmy.C * CS.Maximum);
            MS.Value      = (int)(cmy.M * MS.Maximum);
            YS.Value      = (int)(cmy.Y * YS.Maximum);
        }
예제 #3
0
        public void HSVvalueChanged()
        {
            double multiplier = SS.Maximum;

            hsv = new Hsv {
                H = HS.Value, S = SS.Value / multiplier, V = VS.Value / multiplier
            };
            rgb           = hsv.To <Rgb>();
            BOX.BackColor = Color.FromArgb(alpha, (int)rgb.R, (int)rgb.G, (int)rgb.B);
            hl.Text       = string.Format("H({0:000})", hsv.H);
            sl.Text       = string.Format("S({0:F2})", hsv.S);
            vl.Text       = string.Format("V({0:F2})", hsv.V);
            HS.Value      = (int)hsv.H;
            SS.Value      = (int)(hsv.S * SS.Maximum);
            VS.Value      = (int)(hsv.V * VS.Maximum);
        }
예제 #4
0
 public void RGBvalueChanged2()
 {
     redS.Value   = (int)rgb.R;
     greenS.Value = (int)rgb.G;
     blueS.Value  = (int)rgb.B;
     alphaS.Value = alpha;
     rgb          = new Rgb {
         R = redS.Value, G = greenS.Value, B = blueS.Value
     };
     BOX.BackColor = Color.FromArgb(alpha, (int)rgb.R, (int)rgb.G, (int)rgb.B);
     gl.Text       = string.Format("G({0:000})", rgb.G);
     bl.Text       = string.Format("B({0:000})", rgb.B);
     rl.Text       = string.Format("R({0:000})", rgb.R);
     al.Text       = string.Format("A({0:000})", alpha);
     hsv           = rgb.To <Hsv>();
     luv           = rgb.To <Luv>();
     cmy           = rgb.To <Cmy>();
     xyz           = rgb.To <Xyz>();
 }
예제 #5
0
 public void LUVvalueChanged2()
 {
     //   luv = new Luv { L = LS.Value, U = US.Value, V = V2S.Value };
     if (luv.L == 0)
     {
         rgb = new Rgb {
             R = 0, G = 0, B = 0
         }
     }
     ;
     else
     {
         rgb = luv.To <Rgb>();
     }
     BOX.BackColor = Color.FromArgb(alpha, (int)rgb.R, (int)rgb.G, (int)rgb.B);
     LS.Value      = (int)luv.L;
     US.Value      = (int)luv.U;
     V2S.Value     = (int)luv.V;
     ll.Text       = string.Format("L({0:000})", luv.L);
     ul.Text       = string.Format("U({0:000})", luv.U);
     v2l.Text      = string.Format("V({0:000})", luv.V);
 }