tilde~
Puredata Qt-based GUI
|
Display an analog widget that allows the selection of a HSV color. More...
#include <color_wheel.hpp>
Classes | |
class | Private |
Public Types | |
enum | Display_Enum { SHAPE_DEFAULT = 0x000, SHAPE_TRIANGLE = 0x001, SHAPE_SQUARE = 0x002, SHAPE_FLAGS = 0x00f, ANGLE_DEFAULT = 0x000, ANGLE_FIXED = 0x010, ANGLE_ROTATING = 0x020, ANGLE_FLAGS = 0x0f0, COLOR_DEFAULT = 0x000, COLOR_HSV = 0x100, COLOR_HSL = 0x200, COLOR_LCH = 0x400, COLOR_FLAGS = 0xf00, FLAGS_DEFAULT = 0x000, FLAGS_ALL = 0xfff } |
Public Slots | |
void | setColor (QColor c) |
Set current color. More... | |
void | setHue (qreal h) |
void | setSaturation (qreal s) |
void | setValue (qreal v) |
void | setDisplayFlags (Color_Wheel::Display_Flags flags) |
Set the display flags. More... | |
Signals | |
void | colorChanged (QColor) |
void | colorSelected (QColor) |
void | displayFlagsChanged (Color_Wheel::Display_Flags flags) |
Public Member Functions | |
Color_Wheel (QWidget *parent=0) | |
~Color_Wheel () | |
QColor | color () const |
Get current color. More... | |
QSize | sizeHint () const |
qreal | hue () const |
Get current hue in the range [0-1]. More... | |
qreal | saturation () const |
Get current saturation in the range [0-1]. More... | |
qreal | value () const |
Get current value in the range [0-1]. More... | |
unsigned int | wheelWidth () const |
Get the width in pixels of the outer wheel. More... | |
void | setWheelWidth (unsigned int w) |
Set the width in pixels of the outer wheel. More... | |
Display_Flags | displayFlags (Display_Flags mask=FLAGS_ALL) const |
Get display flags. More... | |
void | setDisplayFlag (Display_Flags flag, Display_Flags mask) |
Set a specific display flag. More... | |
Static Public Member Functions | |
static void | setDefaultDisplayFlags (Display_Flags flags) |
Set the default display flags. More... | |
static Display_Flags | defaultDisplayFlags (Display_Flags mask=FLAGS_ALL) |
Get default display flags. More... | |
Protected Member Functions | |
void | paintEvent (QPaintEvent *) |
void | mouseMoveEvent (QMouseEvent *) |
void | mousePressEvent (QMouseEvent *) |
void | mouseReleaseEvent (QMouseEvent *) |
void | resizeEvent (QResizeEvent *) |
Properties | |
QColor | color |
qreal | hue |
qreal | saturation |
qreal | value |
unsigned wheelWidth | READ |
Display_Flags | displayFlags |
Display an analog widget that allows the selection of a HSV color.
Copyright (C) 2013-2015 Mattia Basaglia This software is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Color Widgets. If not, see <http://www.gnu.org/licenses/>.
It has an outer wheel to select the Hue and an intenal square to select Saturation and Lightness.
|
explicit |
Color_Wheel::~Color_Wheel | ( | ) |
QColor Color_Wheel::color | ( | ) | const |
Get current color.
|
signal |
Emitted when the user selects a color or setColor is called
|
signal |
Emitted when the user selects a color
|
static |
Get default display flags.
Color_Wheel::Display_Flags Color_Wheel::displayFlags | ( | Display_Flags | mask = FLAGS_ALL | ) | const |
Get display flags.
|
signal |
qreal Color_Wheel::hue | ( | ) | const |
Get current hue in the range [0-1].
|
protected |
|
protected |
(without the need to drag)selector_radius => place it there directly
|
protected |
|
protected |
|
protected |
qreal Color_Wheel::saturation | ( | ) | const |
Get current saturation in the range [0-1].
|
slot |
Set current color.
|
static |
Set the default display flags.
void Color_Wheel::setDisplayFlag | ( | Display_Flags | flag, |
Display_Flags | mask | ||
) |
Set a specific display flag.
flag | Flag replacing the mask |
mask | Mask to be cleared |
|
slot |
Set the display flags.
flags | which will replace the current ones |
|
slot |
h | Hue [0-1] |
|
slot |
s | Saturation [0-1] |
|
slot |
v | Value [0-1] |
void Color_Wheel::setWheelWidth | ( | unsigned int | w | ) |
Set the width in pixels of the outer wheel.
QSize Color_Wheel::sizeHint | ( | ) | const |
qreal Color_Wheel::value | ( | ) | const |
Get current value in the range [0-1].
unsigned int Color_Wheel::wheelWidth | ( | ) | const |
Get the width in pixels of the outer wheel.
|
readwrite |
|
readwrite |
|
readwrite |
|
write |
|
readwrite |
|
readwrite |