Update guiColorPicker.h

This commit is contained in:
Anis 2016-02-21 22:10:17 +01:00
parent aed2e0b5b6
commit 5c2bfbf82e

View file

@ -59,29 +59,28 @@ class GuiColorPickerCtrl : public GuiControl
public: public:
enum PickMode enum PickMode
{ {
pPallet = 0, ///< We just have a solid color; We just act like a pallet pPallet = 0, ///< We just have a solid color; We just act like a pallet
pHorizColorRange, ///< We have a range of base colors going horizontally pHorizColorRange, ///< We have a range of base colors going horizontally
pVertColorRange, ///< We have a range of base colors going vertically pVertColorRange, ///< We have a range of base colors going vertically
pHorizColorBrightnessRange, ///< HorizColorRange with brightness pHorizColorBrightnessRange, ///< HorizColorRange with brightness
pVertColorBrightnessRange, ///< VertColorRange with brightness pVertColorBrightnessRange, ///< VertColorRange with brightness
pBlendColorRange, ///< We have a box which shows a range in brightness of the color pBlendColorRange, ///< We have a box which shows a range in brightness of the color
pHorizAlphaRange, ///< We have a box which shows a range in alpha going horizontally pHorizAlphaRange, ///< We have a box which shows a range in alpha going horizontally
pVertAlphaRange, ///< We have a box which shows a range in alpha going vertically pVertAlphaRange, ///< We have a box which shows a range in alpha going vertically
pDropperBackground ///< The control does not draw anything; Only does something when you click, or move the mouse (when active) pDropperBackground ///< The control does not draw anything; Only does something when you click, or move the mouse (when active)
}; };
enum SelectorMode enum SelectorMode
{ {
sHorizontal = 0, ///< Horizontal selector with small gap sHorizontal = 0, ///< Horizontal selector with small gap
sVertical, ///< Vertical selector with small gap sVertical, ///< Vertical selector with small gap
}; };
protected: protected:
/// @name Core Rendering functions /// @name Core Rendering functions
/// @{ /// @{
void renderColorBox(RectI &bounds); ///< Function that draws the actual color box void renderColorBox(RectI &bounds); ///< Function that draws the actual color box
void drawSelector(RectI &bounds, Point2I &selectorPos, SelectorMode mode); ///< Function that draws the selection indicator void drawSelector(RectI &bounds, Point2I &selectorPos, SelectorMode mode); /// < Function that draws the selection indicator
void drawBlendBox(RectI &bounds, ColorF &c1, ColorF &c2, ColorF &c3, ColorF &c4); void drawBlendBox(RectI &bounds, ColorF &c1, ColorF &c2, ColorF &c3, ColorF &c4);
void drawBlendRangeBox(RectI &bounds, bool vertical, U8 numColors, ColorI *colors); void drawBlendRangeBox(RectI &bounds, bool vertical, U8 numColors, ColorI *colors);
/// @} /// @}
@ -127,7 +126,7 @@ class GuiColorPickerCtrl : public GuiControl
/// NOTE: setValue only sets baseColor, since setting pickColor wouldn't be useful /// NOTE: setValue only sets baseColor, since setting pickColor wouldn't be useful
void setValue(ColorF &value) {mBaseColor = value;} void setValue(ColorF &value) {mBaseColor = value;}
/// NOTE: getValue() returns baseColor if pallet (since pallet controls can't "pick" colours themselves) /// NOTE: getValue() returns baseColor if pallet (since pallet controls can't "pick" colours themselves)
ColorF getValue() {return mDisplayMode == pPallet ? mBaseColor : mPickColor;} ColorF getValue() { return mDisplayMode == pPallet ? mBaseColor : mPickColor; }
const char *getScriptValue(); const char *getScriptValue();
void setScriptValue(const char *value); void setScriptValue(const char *value);
void updateColor() {mPositionChanged = true;} void updateColor() {mPositionChanged = true;}