20#ifndef DIALOG_COLOR_PICKER_H 
   21#define DIALOG_COLOR_PICKER_H 
  159    void onSize( wxSizeEvent& event ) 
override;
 
  197        return ( aValue * aValMax ) + 0.5;
 
 
 
A simple color swatch of the kind used to set layer colors.
 
DIALOG_COLOR_PICKER_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Color Picker"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
 
KIGFX::COLOR4D m_previousColor4D
the initial color4d
 
void buttColorClick(wxMouseEvent &event)
Event handler for double click on color buttons.
 
void OnResetButton(wxCommandEvent &aEvent) override
 
void initDefinedColors(CUSTOM_COLORS_LIST *aPredefinedColors)
Create the bitmap buttons for each defined colors.
 
void colorDClick(wxMouseEvent &event)
called when creating the dialog
 
void OnChangeAlpha(wxScrollEvent &event) override
Event handlers from wxSpinControl.
 
void onRGBMouseDrag(wxMouseEvent &event) override
 
wxPoint m_cursorBitmapGreen
the green cursor on the RGB bitmap palette.
 
KIGFX::COLOR4D m_newColor4D
the current color4d
 
double m_val
the current value (0 ... 1.0)
 
void OnChangeEditGreen(wxSpinEvent &event) override
 
void createRGBBitmap()
generate the bitmap that shows the RVB color space
 
DIALOG_COLOR_PICKER(wxWindow *aParent, const KIGFX::COLOR4D &aCurrentColor, bool aAllowOpacityControl, CUSTOM_COLORS_LIST *aUserColors=nullptr, const KIGFX::COLOR4D &aDefaultColor=KIGFX::COLOR4D::UNSPECIFIED)
Dialog constructor.
 
KIGFX::COLOR4D GetColor()
 
std::vector< wxStaticBitmap * > m_colorSwatches
list of defined colors buttons
 
wxBitmap * m_bitmapRGB
the basic RGB palette
 
void OnChangeEditBlue(wxSpinEvent &event) override
 
wxPoint m_cursorBitmapBlue
the blue cursor on the RGB bitmap palette.
 
wxBitmap * m_bitmapHSV
the basic HUV palette
 
void OnColorValueText(wxCommandEvent &event) override
Event handler for the reset button press.
 
void createHSVBitmap()
generate the bitmap that shows the HSV color circle
 
std::vector< KIGFX::COLOR4D > m_Color4DList
the list of color4d ordered by button ID, for predefined colors
 
void onRGBMouseClick(wxMouseEvent &event) override
 
wxPoint m_cursorBitmapRed
the red cursor on the RGB bitmap palette.
 
double m_hue
the current hue, in degrees (0 ... 360)
 
bool setHSvaluesFromCursor(const wxPoint &aMouseCursor)
Manage the Hue and Saturation settings when the mouse cursor is at aMouseCursor.
 
void OnChangeEditSat(wxSpinEvent &event) override
mouse handlers, when clicking on a palette bitmap
 
double m_sat
the current saturation (0 ... 1.0)
 
bool m_allowOpacityCtrl
true to show the widget, false to keep alpha channel = 1.0
 
bool TransferDataToWindow() override
 
void drawHSVPalette()
draws the HSV color circle
 
void onHSVMouseClick(wxMouseEvent &event) override
 
void onHSVMouseDrag(wxMouseEvent &event) override
 
void updatePreview(wxStaticBitmap *aStaticBitmap, KIGFX::COLOR4D &aColor4D)
Event handler from wxSlider: brightness (value) control.
 
void onSize(wxSizeEvent &event) override
 
KIGFX::COLOR4D m_defaultColor
The default color4d.
 
void OnChangeEditRed(wxSpinEvent &event) override
 
void OnChangeEditHue(wxSpinEvent &event) override
 
int normalizeToInt(double aValue, int aValMax=255)
 
void SetEditVals(CHANGED_COLOR aChanged, bool aCheckTransparency)
 
wxPoint m_cursorBitmapHSV
the cursor on the HSV bitmap palette.
 
void drawRGBPalette()
draws the RVB color space
 
void OnChangeBrightness(wxScrollEvent &event) override
Event handler from wxSlider: alpha (transparency) control.
 
wxPoint * m_selectedCursor
the ref cursor to the selected cursor, if any, or null.
 
A color representation with 4 components: red, green, blue, alpha.
 
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
 
std::vector< CUSTOM_COLOR_ITEM > CUSTOM_COLORS_LIST
 
CUSTOM_COLOR_ITEM(double red, double green, double blue, double alpha, const wxString &aName)
 
CUSTOM_COLOR_ITEM(double red, double green, double blue, const wxString &aName)
 
CUSTOM_COLOR_ITEM(const KIGFX::COLOR4D &aColor, const wxString &aName)