GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
AG_HSVPAL(3) FreeBSD Library Functions Manual AG_HSVPAL(3)

AG_HSVPalagar HSV color picker

#include <agar/core.h>
#include <agar/gui.h>

The AG_HSVPal widget is a HSV (Hue, Saturation, Value) color editor which allows the user to edit a color's hue, saturation, value and alpha components. The widget can bind directly to different color representations:

  • A native Agar AG_Color(3).
  • Single-precision Hue, Saturation, Value and Alpha.
  • 8- or 16-bit integer RGBA components.
  • Floating-point RGBA components.
  • A 32- or 64-bit packed pixel (with corresponding AG_PixelFormat(3)).

AG_Object(3) -> AG_Widget(3) -> AG_HSVPal.

AG_HSVPal *
(AG_Widget *parent, Uint flags);

The () function allocates, initializes, and attaches a new AG_HSVPal widget. Acceptable flags include:

AG_HSVPAL_SHOW_RGB
Show the RGB value in text form.
AG_HSVPAL_SHOW_HSV
Show the HSV value in text form.
AG_HSVPAL_NOALPHA
(Read-only) Transparency control is disabled. Set (or cleared) when pixel-format is bound to a pixel format with (or without) alpha.
AG_HSVPAL_FORCE_NOALPHA
Disable the transparency control.
AG_HSVPAL_NOPREVIEW
Disable the color preview band.
AG_HSVPAL_HFILL
Expand horizontally in parent container.
AG_HSVPAL_VFILL
Expand vertically in parent container.
AG_HSVPAL_EXPAND
Shorthand for AG_HSVPAL_HFILL | .

void
AG_HSVPalUpdateHue(AG_HSVPal *pal, int x, int y);


void
(AG_HSVPal *pal, int x, int y);

() sets the hue to that closest to cursor coordinates x, y and triggers a refresh. AG_HSVPalUpdateSV() sets the saturation and value to that at cursor coordinates x, y and triggers a refresh.

The AG_HSVPal widget provides the following bindings:

AG_Color *agcolor
A native AG_Color(3) structure.
float *hue
Hue (0..1).
float *saturation
Saturation (0..1).
float *value
Value (0..1).
float *alpha
Single-precision component value (0..1).
AG_PixelFormat **pixel-format
Pointer to AG_PixelFormat(3) describing the packed-pixel format of pixel and pixel64. Note that pixel-format should be set first. If the format has an alpha component, AG_HSVPAL_NOALPHA will be set accordingly (use AG_HSVPAL_FORCE_NOALPHA to disable).
Uint32 *pixel
32-bit packed pixel value.
Uint64 *pixel64
64-bit packed pixel value. Available in AG_LARGE build.
void *RGBv
A three-element array containing the RGB components. Acceptable binding types include FLOAT and DOUBLE, INT and UINT8. For floating point types, the values are scaled to 0.0-1.0. For integral types, the values are scaled to 0-255.
void *RGBAv
Same as above, except that the array has 4 elements where the last element is the alpha component.

The AG_HSVPal widget generates the following events:

(void)
The hue has changed.
(void)
The saturation or the value has changed.

Conversion between integer RGB and HSV triplets incurs loss of precision. In cases where it is desirable to maintain the same hue throughout changes in saturation, the color should be stored in HSV format.

AG_Intro(3), AG_Widget(3), AG_Window(3)

EasyRGB
 
HSV Color Space
 
RGB Color Model
 

The AG_HSVPal widget first appeared in Agar 1.0. The pixel64 binding, AG_HSVPalUpdateHue() and AG_HSVPalUpdateSV() appeared in Agar 1.6.0.

December 21, 2022 Agar 1.7

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.