Home  /  Autodocs

getcolor.gadget

Create getcolor BOOPSI objects

FUNCTIONS

GCOLOR_REQUEST GETCOLOR_GetClass

SUPERCLASS

gadgetclass

REQUIRES

window.class, button.gadget, layout.gadget, slider.gadget, colorwheel.gadget, gradientslider.gadget, space.gadget, radiobutton.gadget, bevel.image, label.image

DESCRIPTION

The getcolor gadget class is used to define and select colors from a standard color requester in an easy and consistent way. It consists of a button gadget that is used to open the color requester and show the result (the currently selected color).

NOTES

This class provides several attributes allowing to override the user's global choices for the color requester contents and layout. However, it is not recommended to do so without a good reason.

Good reasons may include the necessity of keeping the requester size as small as possible, or other special requirements of your application which make it necessary to filter out some of the possible options. If you really need to do this, try to offer the user the ability to switch off such limitations.

For normal applications, no attributes should ever be set other than GETCOLOR_TitleText, GETCOLOR_Screen and those affecting the current color value such as GETCOLOR_Color or the various 32-bit variants thereof.

ATTRIBUTES

GA_ID (UWORD)
Unique ID number for the gadget.

Defaults to 0.

Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY)

GA_Disabled (BOOL)
Set to TRUE to disable gadget, FALSE otherwise.

Defaults to FALSE.

Applicability is (OM_NEW, OM_SET, OM_GET)

GA_TextAttr (struct TextAttr *)
Font to use for the gadget text.

Defaults to the screen's font.

Applicability is (OM_NEW, OM_SET, OM_GET)

GA_BackFill (struct Hook *)
A layer backfill hook to provide a more complex background pattern. See InstallLayerHook() for more details about the backfill hook.

Defaults to NULL.

Applicability is (OM_NEW, OM_SET)

GETCOLOR_TitleText (CONST_STRPTR)
Title of the color requester.

Defaults to "Color" (localized).

Applicability is (OM_NEW, OM_SET)

GETCOLOR_Screen (struct Screen *)
Screen for allocation of needed pens for the display. This MUST be provided and MUST remain open until after the gadget has been disposed.

Applicability is (OM_NEW, OM_SET, OM_GET)

GETCOLOR_Color (ULONG)
Current color value, expressed as a 0x00RRGGBB longword.

Defaults to 0 (black).

Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY)

GETCOLOR_Red (ULONG)
Red component of the current color, expressed as a 32-bit left-justified fraction.

Defaults to 0 (no red).

Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY)

GETCOLOR_Green (ULONG)
Green component of the current color, expressed as a 32-bit left-justified fraction.

Defaults to 0 (no green).

Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY)

GETCOLOR_Blue (ULONG)
Blue component of the current color, expressed as a 32-bit left-justified fraction.

Defaults to 0 (no blue).

Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY)

GETCOLOR_Hue (ULONG)
Hue value of the current color, expressed as a 32-bit left-justified fraction.

Defaults to 0 (full red).

Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY)

GETCOLOR_Saturation (ULONG)
Saturation value of the current color, expressed as a 32-bit left-justified fraction.

Defaults to 0 (no saturation).

Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY)

GETCOLOR_Brightness (ULONG)
Brightness value of the current color, expressed as a 32-bit left-justified fraction.

Defaults to 0L (full darkness).

Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY)

GETCOLOR_RGB (struct ColorWheelRGB *)
RGB components of the current color, expressed as 32-bit left-justified fractions. This allows to set or get all of them with a single operation.

Defaults to 0/0/0 (black).

Applicability is (OM_NEW, OM_SET, OM_GET)

GETCOLOR_HSB (struct ColorWheelHSB *)
HSB values of the current color, expressed as 32-bit left-justified fractions. This allows to set or get all of them with a single operation.

Defaults to 0/0/0 (black).

Applicability is (OM_NEW, OM_SET, OM_GET)

GETCOLOR_ColorWheel (BOOL)
If TRUE, the color requester will include a color wheel and a gradient slider.

Defaults to TRUE.

Applicability is (OM_NEW, OM_SET)

GETCOLOR_RGBSliders (BOOL)
If TRUE, the color requester will include sliders to select the red/green/blue color components.

Defaults to TRUE.

Applicability is (OM_NEW, OM_SET)

GETCOLOR_HSBSliders (BOOL)
If TRUE, the color requester will include sliders to select the hue/saturation/brightness color values.

Defaults to FALSE.

Applicability is (OM_NEW, OM_SET)

GETCOLOR_SwitchMode (BOOL)
If TRUE, the user will be able to switch between RGB and HSB sliders in the color requester, rather than having both sets displayed at the same time (to save space). Setting this automatically implies TRUE for the two previous attributes.

Defaults to TRUE.

Applicability is (OM_NEW, OM_SET)

GETCOLOR_Initial (UWORD)
Which set of sliders will be displayed initially, if GETCOLOR_SwitchMode is TRUE (0 == RGB, 1 == HSB).

Defaults to 0 (RGB).

Applicability is (OM_NEW, OM_SET)

GETCOLOR_ShowRGB (BOOL)
If TRUE, the color requester will include display boxes showing the current red/green/blue amounts.

Defaults to FALSE.

Applicability is (OM_NEW, OM_SET)

GETCOLOR_ShowHSB (BOOL)
If TRUE, the color requester will include display boxes showing the current hue/saturation/brightness amounts.

Defaults to FALSE.

Applicability is (OM_NEW, OM_SET)

GETCOLOR_SmallTextAttr (struct TextAttr *)
Font to use for the RGB/HSB display boxes; it should be as small as possible (while still being readable) to avoid making the color requester too large.

Defaults to the current user-selected "fallback font" from user preferences or to the normal gadget font if no "fallback font" is defined.

Applicability is (OM_NEW, OM_SET)