HsbToColor() public static method

Returns a Color structure specified by HSB values.
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.
return Color
示例#1
0
        private void cdPicker_ColorChanged()
        {
            Color c = PaintFunctions.HsbToColor(cdSlider.SelectedHue, cdPicker.Saturation, cdPicker.Brightness);

            selected_color = c;
            colorInfo.GrabFromColor(c);
            update();
        }
示例#2
0
        /**************************************************/
        /* 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);
            }
        }