public static HsbToColor ( float h, float s, float b ) : Color | ||
h | float | The hue of the color. |
s | float | The saturation of the color. |
b | float | The brightness of the color. |
Résultat | Color |
private void cdPicker_ColorChanged() { Color c = PaintFunctions.HsbToColor(cdSlider.SelectedHue, cdPicker.Saturation, cdPicker.Brightness); selected_color = c; colorInfo.GrabFromColor(c); update(); }
/**************************************************/ /* constructors */ /**************************************************/ public ColorDlgSlider() { SetStyle(ControlStyles.UserMouse, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); float s = 1.0f; float b = 0.5f; float h = 0.0f; for (int i = 0; i < 256; i++) { h = i * 360 / 256; ColorList[i] = PaintFunctions.HsbToColor(h, s, b); } }