ImFusion SDK 4.3
HsvColorPicker2d Class Reference

#include <ImFusion/GUI/CoreWidgets/HsvColorPicker.h>

QWidget allowing for selecting 2 components of the HSV color space. More...

+ Inheritance diagram for HsvColorPicker2d:

Detailed Description

QWidget allowing for selecting 2 components of the HSV color space.

Renders the color gradient of the two selected components and offers user interaction to select the corresponding color underneath. The third component of the HSV color space is fixed.

See also
HsvHueSlider, OpacitySlider, ColorPickerWidget, ColorButton

Public Types

enum class  Component { Hue , Saturation , Value }
 HSV color space component.
 

Signals

void colorChanged (QColor)
 

Public Member Functions

 HsvColorPicker2d (QWidget *parent=nullptr)
 Creates a new HsvColorPicker2d widget.
 
void setComponents (Component xComponent, Component yComponent)
 Set the HSV components to plot along the two widget axes, must be different from each other.
 
QColor color () const
 Returns the currently selected color.
 
void setColor (const QColor &c)
 Sets current color.
 
double hue () const
 Returns the currently selected hue in the range [0..1].
 
void setHue (double h)
 Sets the currently selected hue in the range [0..1].
 
double saturation () const
 Returns the currently selected saturation in the range [0..1].
 
void setSaturation (double s)
 Sets the currently selected saturation in the range [0..1].
 
double value () const
 Returns the currently selected value in the range [0..1].
 
void setValue (double v)
 Sets the currently selected value in the range [0..1].
 
QSize sizeHint () const override
 

Protected Member Functions

void paintEvent (QPaintEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void resizeEvent (QResizeEvent *event) override
 

Member Function Documentation

◆ setComponents()

void setComponents ( Component xComponent,
Component yComponent )

Set the HSV components to plot along the two widget axes, must be different from each other.

Parameters
xComponentHSV color space component to plot along the X axis.
yComponentHSV color space component to plot along the Y axis.

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close