Remoto - VFS: colorField Class Reference
Remoto - VFS

The colorField class adds a color selector to a form. More...

#include <colorField.h>

Inheritance diagram for colorField:
VFS_form_field

Classes

struct  hsv
 HSV value struct, using double precision. More...
 
struct  rgb
 RGB value struct, using double precision. More...
 

Public Member Functions

 colorField (QString c, QString label="", QString tip="")
 
- Public Member Functions inherited from VFS_form_field
 VFS_form_field (QJsonValue val, QString type, QString label="", QString tip="")
 
 VFS_form_field (QString type)
 
void clearOption (QString o)
 Clear/remove a widget option. More...
 
int getIndex ()
 Get the field index. More...
 
QString getLabel ()
 Return the label. More...
 
void setAllowEmpty (bool e)
 Validate this field against empty-ness. More...
 
void setEnabled (bool e)
 Enable or disable this field. More...
 
void setHidden (bool e)
 Keep the field, but hide it when rendering. More...
 
void setHideLabel (bool l)
 Hide the label for this field. More...
 
void setIndex (int i)
 Set the field index for this widget. More...
 
void setLabel (QString l, bool replace=true)
 Set the label. More...
 
void setOption (QString o, QJsonValue v)
 Set a widget option. More...
 
void setSpellcheck (bool s)
 Enable or disable spellchecking on this text field. More...
 
void setTip (QString t)
 Set the tooltip. More...
 
void setValue (QJsonValue val)
 Set the value. More...
 

Static Public Member Functions

static QString fromHSV (qreal h, qreal s, qreal v)
 Convert HSV values to a hex RGB value. More...
 
static colorField::rgb hsv2rgb (colorField::hsv in)
 Convert an incoming HSV value to RGB. More...
 
static QString random (qreal hc=0.0, qreal hrange=1.0, qreal s=1.0, qreal v=0.75)
 Generate a random color based on HSV ranges. More...
 
static colorField::hsv rgb2hsv (colorField::rgb in)
 Convert an incoming RGB value to HSV. More...
 

Additional Inherited Members

- Protected Attributes inherited from VFS_form_field
QJsonObject options
 Options for any widget type... this is an arbitrary list. More...
 

Detailed Description

The colorField class adds a color selector to a form.

The initial value can be randomized based on HSV ranges.

Definition at line 6 of file colorField.h.

Constructor & Destructor Documentation

◆ colorField()

colorField::colorField ( QString  c,
QString  label = "",
QString  tip = "" 
)
explicit
Parameters
cThe initial color value, as a hex string
labelThe label
tipThe tooltip

Definition at line 24 of file colorField.cpp.

Member Function Documentation

◆ fromHSV()

QString colorField::fromHSV ( qreal  h,
qreal  s,
qreal  v 
)
static

Convert HSV values to a hex RGB value.

Parameters
hhue
ssaturation
vvalue
Returns
QString RGB hex value

Definition at line 57 of file colorField.cpp.

◆ hsv2rgb()

colorField::rgb colorField::hsv2rgb ( colorField::hsv  in)
static

Convert an incoming HSV value to RGB.

Parameters
inHSV value
Returns
rgb RGB value

Definition at line 127 of file colorField.cpp.

◆ random()

QString colorField::random ( qreal  hc = 0.0,
qreal  hrange = 1.0,
qreal  s = 1.0,
qreal  v = 0.75 
)
static

Generate a random color based on HSV ranges.

Parameters
hcThe center of the hue value
hrangeThe distance from the center to randomly choose
sThe saturation
vThe value
Returns
QString RGB hex value

Definition at line 38 of file colorField.cpp.

◆ rgb2hsv()

colorField::hsv colorField::rgb2hsv ( colorField::rgb  in)
static

Convert an incoming RGB value to HSV.

Parameters
inRGB value
Returns
hsv HSV value

Definition at line 77 of file colorField.cpp.


The documentation for this class was generated from the following files: