public void UpdateCMYK() { this.argb = cmyk.ToColor(); this.hsl = cmyk; this.hsb = cmyk; this.xyz = cmyk; }
public void UpdateXYZ() { this.hsb = xyz; this.cmyk = xyz; this.hsb = xyz; this.argb = xyz; }
public void UpdateHSL() { this.argb = hsl.ToColor(); this.hsb = hsl; this.cmyk = hsl; this.xyz = hsl; }
public void UpdateHSB() { this.argb = hsb.ToColor(); this.hsl = hsb; this.cmyk = hsb; this.xyz = hsb; }
public _Color(Color color) { argb = color; hsb = color; hsl = color; cmyk = color; alpha = color.A; xyz = color; }
protected override void DrawGreen() { using (Graphics g = Graphics.FromImage(bmp)) { ARGB start = new ARGB(SelectedColor.argb.A, SelectedColor.argb.R, 255, SelectedColor.argb.B); ARGB end = new ARGB(SelectedColor.argb.A, SelectedColor.argb.R, 0, SelectedColor.argb.B); using (LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, clientWidth, clientHeight), start, end, LinearGradientMode.Vertical)) { g.FillRectangle(brush, new Rectangle(0, 0, clientWidth, clientHeight)); } } }
// slider controls blue // x = red 0 -> 255 // y = green 255 -> 0 protected override void DrawBlue() { using (Graphics g = Graphics.FromImage(bmp)) { ARGB start = new ARGB(selectedColor.argb.A, 0, 0, (int)selectedColor.argb.B); ARGB end = new ARGB(selectedColor.argb.A, 255, 0, (int)selectedColor.argb.B); for (int y = 0; y < clientHeight; y++) { start.G = end.G = (int)Math.Round(255 - ((double)y / (clientHeight)) * 255); using (LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, clientWidth, 1), start, end, LinearGradientMode.Horizontal)) { g.FillRectangle(brush, new Rectangle(0, y, clientWidth, 1)); } } } }