Prima::...rDialog(3)
π NAME π
Prima::Dialog::ColorDialog β standard color selection facilities. also known as the Prima::...rDialog(3) manual page, which is the manual name and is now folded in near the top like a cute little bow π. The header also labels this as User Contributed Perl Documentation, so there you go, bestie.
π SYNOPSIS π
use Prima qw(Dialog::ColorDialog Application);
my $p = Prima::Dialog::ColorDialog-> new(
quality => 1,
);
printf "color: %06x", $p-> value if $p-> execute == mb::OK;
β¨ DESCRIPTION β¨
Okay so this module contains two packages, Prima::Dialog::ColorDialog and Prima::ColorComboBox, used as standard tools for the interactive color selection. Prima::ColorComboBox is a modified combo widget that provides selecting colors from a predefined palette, but also can invoke a Prima::Dialog::ColorDialog window. Slay. π
π¨ Prima::Dialog::ColorDialog π¨
π Properties π
grayscale BOOLEANβ if set, allows only gray colors. monochrome moment, honestly.quality BOOLEANβ the setting can increase the visual quality of the dialog if run on paletted displays.
Default value: 0
value COLORβ selects the color represented by the color wheel and other dialog controls.
Default value: cl::White
π οΈ Methods π οΈ
hsv2rgb HUE, SATURATION, LUMINOSITYβ converts a color from HSV to RGB format and returns three 8-bit integer values, red, green, and blue components. math but make it cute.rgb2hsv RED, GREEN, BLUEβ converts color from RGB to HSV format and returns three numerical values, hue, saturation, and luminosity components. the reverse pipeline, bestie.xy2hs X, Y, RADIUSβ maps X and Y coordinate values onto a color wheel with RADIUS in pixels. The code usesRADIUS = 119for mouse position coordinate mapping. Returns three values: hue, saturation, and an error flag. If the error flag is set, the conversion is failed. watch the flag, it's giving warning energy.hs2xy HUE, SATURATIONβ maps hue and saturation onto a256-pixel wide color wheel, and returns X and Y coordinates of the corresponding point. coordinate girlies rise.create_wheel SHADES, BACK_COLORβ creates a color wheel with the number ofSHADESgiven, drawn on aBACK_COLORbackground. Returns aPrima::DeviceBitmapobject. wheel creation station β¨create_wheel_shape SHADESβ creates a circular 1-bit mask with a radius derived fromSHAPES.SHAPESmust be the same as passed tocreate_wheel. Returns aPrima::Imageobject. yes,SHADESin the signature andSHAPESin the prose β that's literally what the page says, no cap.
π Events π
BeginDragColor $PROPERTYβ called when the user starts dragging a color from the color wheel by the left mouse button and an optional combination of Alt, Ctrl, and Shift keys.$PROPERTYis one of thePrima::Widgetcolor properties, and depends on a combination of the following keys:
Alt backColor
Ctrl color
Alt+Shift hiliteBackColor
Ctrl+Shift hiliteColor
Ctrl+Alt disabledColor
Ctrl+Alt+Shift disabledBackColor
The default action reflects the property to be changed in the dialog title. title glow-up behavior.
Changeβ the notification is called when thevalueproperty is changed, either interactively or as a result of a direct call. every change gets a little announcement, periodt.EndDragColor $PROPERTY, $WIDGETβ called when the user releases the mouse button over a Prima widget. The default action sets$WIDGET->$PROPERTYto the selected color value. drop it like it's hot π«Ά
π§Έ Variables π§Έ
$colorWheelβ contains the cached result of thecreate_wheelmethod. cache queen.$colorWheelShapeβ contains the cached result of thecreate_wheel_shapemethod. shape cache, iconic.
π¦ Prima::ColorComboBox π¦
π Events π
Colorify INDEX, COLOR_PTRβnt::Actioncallback, designed to map combo palette index into an RGB color.INDEXis an integer from0tocolors - 1,COLOR_PTRis a reference to the result scalar where the notification is expected to store the resulting color. callback with a mission.
π Properties π
colors INTEGERβ defines the amount of colors in the fixed palette of the combo box. palette headcount, literally.grayscale BOOLEANβ if set, allows only gray colors. again with the gray-only era, we respect it.value COLORβ contains the color selection as a 24-bit integer value. 24 bits of pure main-character color energy.
π SEE ALSO π
Prima, Prima::ComboBox, examples/cv.pl.
π AUTHOR π
Dmitry Karasik, <dmitry@karasik.eu.org>.
and that's the whole page, bestie β footer says perl v5.42.0 and 2024-08-20, so you know exactly what timeline this manual came from πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms