|
Laxkit
0.0.7.1
|
Defines various simple conversions between rgb, cmyk, gray, and hsv. More...

Public Member Functions | |
| ColorBase (int ctype, int nmax, int c0, int c1, int c2, int c3=-1, int c4=-1) | |
| virtual int | ColorChanged () |
| Return 1 if the color array does not match the oldcolor array. Usually called after button up, compared to button down. | |
| virtual void | Updated () |
| Called when a value is changed through any of the various color setting functions. | |
| virtual void | Clamp () |
| For each field, make sure it is in range [0..max]. | |
| virtual void | RestoreColor () |
| Revert colors to oldcolor. | |
| virtual void | SetMax (int newmax) |
| virtual void | SetRGB (int r, int g, int b, int a=-1) |
| Set the channel when the value is >= 0. | |
| virtual void | SetGray (int g, int a=-1) |
| Set the channel when the value is >= 0. | |
| virtual void | SetCMYK (int c, int m, int y, int k, int a=-1) |
| Set the channel when the value is >= 0. | |
| virtual void | SetHSV (int h, int s, int v, int a=-1) |
| virtual void | SetRGB (double r, double g, double b, double a=-1) |
| virtual void | SetGray (double g, double a=-1) |
| virtual void | SetCMYK (double c, double m, double y, double k, double a=-1) |
| virtual void | SetHSV (double h, double s, double v, double a=-1) |
| virtual void | CMYK (double *cmyk) |
| Fill cmyk[4] with double values. | |
| virtual void | RGB (double *rgb) |
| Fill rgb[3] with double values. | |
| virtual void | HSV (double *hsv) |
| Fill hsv[3] with double values. | |
| virtual char * | HexValue (char *buffer) |
| buffer must be at least 10 characters long, or you will segfault. | |
| virtual int | SetHexValue (const char *hex) |
| virtual int | Red () |
| virtual int | Red (int r) |
| virtual double | Redf (double r) |
| virtual double | Redf () |
| virtual int | Green () |
| virtual int | Green (int g) |
| virtual double | Greenf (double g) |
| virtual double | Greenf () |
| virtual int | Blue () |
| virtual int | Blue (int b) |
| virtual double | Bluef (double b) |
| virtual double | Bluef () |
| virtual int | Gray () |
| virtual int | Gray (int g) |
| virtual double | Grayf (double g) |
| virtual double | Grayf () |
| virtual int | Cyan () |
| virtual int | Cyan (int c) |
| virtual double | Cyanf (double c) |
| virtual double | Cyanf () |
| virtual int | Magenta () |
| virtual int | Magenta (int m) |
| virtual double | Magentaf (double m) |
| virtual double | Magentaf () |
| virtual int | Yellow () |
| virtual int | Yellow (int y) |
| virtual double | Yellowf (double y) |
| virtual double | Yellowf () |
| virtual int | Black () |
| virtual int | Black (int k) |
| virtual double | Blackf (double k) |
| virtual double | Blackf () |
| virtual int | Alpha () |
| virtual int | Alpha (int a) |
| virtual double | Alphaf (double a) |
| virtual double | Alphaf () |
| virtual int | Hue () |
| virtual int | Hue (int h) |
| virtual double | Huef (double h) |
| virtual double | Huef () |
| virtual int | Saturation () |
| virtual int | Saturation (int s) |
| virtual double | Saturationf (double s) |
| virtual double | Saturationf () |
| virtual int | Value () |
| virtual int | Value (int v) |
| virtual double | Valuef (double v) |
| virtual double | Valuef () |
Public Attributes | |
| int | colortype |
| int | max |
| int | oldcolor [5] |
| int | color1 [5] |
| int | color2 [5] |
| int * | colors |
Defines various simple conversions between rgb, cmyk, gray, and hsv.
buffer must be at least 10 characters long, or you will segfault.
Puts something like "#ff00abff" (without the quotes) in buffer. Returns buffer.
Referenced by Laxkit::ColorSliders::EditHex().
Set the channel when the value is >= 0.
Any values over max are clamped.
Any call to this function will set the color mode to LAX_COLOR_CMYK.
Referenced by LaxInterfaces::ViewportWithStack::Event(), and LaxInterfaces::ViewerWindow::Event().
|
virtual |
Values in [0..1].
Set the channel when the value is >= 0.
Any values over max are clamped.
Any call to this function will set the color mode to LAX_COLOR_CMYK.
Referenced by LaxInterfaces::ViewportWithStack::Event(), and LaxInterfaces::ViewerWindow::Event().
Return 0 for success, or 1 for parse error. hex must be something like "#00ff00ff", with 8 digits. The '#' is optional.
Referenced by Laxkit::ColorSliders::Event().
Set the channel when the value is >= 0.
Any values over max are clamped.
Any call to this function will set the color mode to LAX_COLOR_RGB.
Referenced by LaxInterfaces::ViewportWithStack::Event(), and LaxInterfaces::ViewerWindow::Event().
|
virtual |
Values in [0..1].
|
virtual |
Called when a value is changed through any of the various color setting functions.
Default is do nothing.