/// <summary> /// Value [0,100] /// </summary> public static Color?GetRgbValueOfHsvCirclePixelCoords(int x, int y, int value) { double hue, saturation; bool colorExistsForThesePixelCoords = GetHueAndSaturationOfPixelCoords(x, y, out hue, out saturation); if (colorExistsForThesePixelCoords) { return(ColorHSVConverter.ColorFromHSV(hue, saturation, value)); } return(null); }
/// <summary> /// Hue [0,360], Saturation [0,100] /// </summary> public static Bitmap DrawValueBar(double hue, double saturation) { var result = new Bitmap(HueSaturationSize, ValuePickerHeight); for (int x = 0; x < HueSaturationSize; x++) { double value = x / (double)HueSaturationSize * 100; var color = ColorHSVConverter.ColorFromHSV(hue, saturation, value); for (int y = 0; y < ValuePickerHeight; y++) { result.SetPixel(x, y, color); } } return(result); }
private void UpdateSelectedColor() { _selectedColor = ColorHSVConverter.ColorFromHSV(_hue, _saturation, _value); panelSelectedColor.BackColor = _selectedColor; }