Prima::Dialog::ColorDialog - standard color selection facilities
use Prima qw(Dialog::ColorDialog Application); my $p = Prima::Dialog::ColorDialog-> new( quality => 1, ); printf "color: %06x", $p-> value if $p-> execute == mb::OK;
The 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.
Prima::Dialog::ColorDialog
Prima::ColorComboBox
If set, allows only gray colors
The setting can increase the visual quality of the dialog if run on paletted displays.
Default value: 0
Selects the color represented by the color wheel and other dialog controls.
Default value: cl::White
cl::White
Converts a color from HSV to RGB format and returns three 8-bit integer values, red, green, and blue components.
Converts color from RGB to HSV format and returns three numerical values, hue, saturation, and luminosity components.
Maps X and Y coordinate values onto a color wheel with RADIUS in pixels. The code uses RADIUS = 119 for mouse position coordinate mapping. Returns three values, - hue, saturation, and error flag. If the error flag is set, the conversion is failed.
Maps hue and saturation onto a 256-pixel wide color wheel, and returns X and Y coordinates of the corresponding point.
Creates a color wheel with the number of SHADES given, drawn on a BACK_COLOR background. Returns a Prima::DeviceBitmap object.
Prima::DeviceBitmap
Creates a circular 1-bit mask with a radius derived from SHAPES. SHAPES must be the same as passed to create_wheel. Returns a Prima::Image object.
Prima::Image
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. $PROPERTY is one of the Prima::Widget color properties, and depends on a combination of the following keys:
Prima::Widget
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
The notification is called when the value property is changed, either interactively or as a result of a direct call.
Called when the user releases the mouse button over a Prima widget. The default action sets $WIDGET->$PROPERTY to the selected color value.
$WIDGET->$PROPERTY
Contains the cached result of the create_wheel method.
Contains the cached result of the create_wheel_shape method.
nt::Action callback, designed to map combo palette index into an RGB color. INDEX is an integer from 0 to colors - 1, COLOR_PTR is a reference to the result scalar where the notification is expected to store the resulting color.
nt::Action
Defines the amount of colors in the fixed palette of the combo box.
Contains the color selection as a 24-bit integer value.
Prima, Prima::ComboBox, examples/cv.pl.
Dmitry Karasik, <dmitry@karasik.eu.org>.
To install Prima, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prima
CPAN shell
perl -MCPAN -e shell install Prima
For more information on module installation, please visit the detailed CPAN module installation guide.