Esempio n. 1
0
        protected virtual RGBStruct ColourFunction(double x, double y)
        {
            CIEXYYColor xyy = new CIEXYYColor(x, y, 1.0);

            CIEXYZColour xyz = (CIEXYZColour)xyy;

            RGBColor rgb = xyz.ToRGB(cieRgbDefinition, false);

            if (rgb.OutOfGamut)
                return new RGBStruct(rgb.Rb, rgb.Gb, rgb.Bb, 128); // Values are clamped automatically
            else
                return new RGBStruct(rgb.Rb, rgb.Gb, rgb.Bb, 255);
        }
Esempio n. 2
0
 public void SetXYY(CIEXYYColor xyy)
 {
     TransferPacket<XYYStruct>(CMD_SET_XYY, new XYYStruct
     {
         x = (float)xyy.x,
         y = (float)xyy.y,
         Y = (float)xyy.Y
     });
 }
Esempio n. 3
0
 private void TemperatureChanged()
 {
     xyzColor = (CIEXYZColour)temperature;
     xyyColor = (CIEXYYColor)xyzColor;
     rgbColor = (RGBColor)xyzColor;
     hsvColor = (HSVColor)rgbColor;
     //this.RgbChanged();
 }
Esempio n. 4
0
 private void RgbChanged()
 {
     hsvColor = (HSVColor)rgbColor;
     xyzColor = rgbColor;
     xyyColor = xyzColor;
     //application.color = rgbColor;
 }
Esempio n. 5
0
 private void HsvChanged()
 {
     rgbColor = hsvColor.ToRGB();
     xyzColor = rgbColor;
     xyyColor = xyzColor;
     //application.color = rgbColor;
 }
Esempio n. 6
0
 private void CieXYZChanged()
 {
     rgbColor = xyzColor;
     xyyColor = xyzColor;
     hsvColor = rgbColor;
 }
Esempio n. 7
0
 protected Point xyz2pt(CIEXYYColor xyy)
 {
     double width = this.ActualWidth;
     double height = this.ActualHeight;
     return new Point(width * xyy.x, height * xyy.y);
 }