The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

FLTK::ColorChooser - Color chooser for the Fast Light Tool Kit

Description

The color chooser object and the color chooser popup. The popup is just a window containing a single color chooser and some boxes to indicate the current and cancelled color.

Functions

a

my $alpha = $colorchooser->a( );
my $set = $colorchooser->a( $alpha );

b

my $blue = $colorchooser->b( );

color_chooser

my $okay = $colorchooser->color_chooser( $name, $r, $g, $b );

FLTK::color_chooser() pops up a window to let the user pick an arbitrary RGB color. They can pick the hue and saturation in the "hue box" on the left (hold down CTRL to just change the saturation), and the brighness using the vertical slider. Or they can type the 8-bit numbers into the RGB FLTK::ValueInput fields, or drag the mouse across them to adjust them. The pull-down menu lets the user set the input fields to show RGB, HSV, or 8-bit RGB (0 to 255).

This returns non-zero if the user picks ok, and updates the RGB values. If the user picks cancel or closes the window this returns zero and leaves RGB unchanged.

This version takes and returns numbers in the 0-1 range.

If you which to embed a color chooser into another control panel, use an FLTK::ColorChooser object.

my $okay = $colorchooser->color_chooser( $name, $r, $g, $b, $a );

Same but user can also select an alpha value. Currently the color chips do not remember or set the alpha!

my $okay = $colorchooser->color_chooser( $name, $color );

Same but it takes and returns an FLTK::Color number. No alpha.

g

my $green = $colorchooser->g( );

h

my $hue = $colorchooser->h( );

hide_a

$colorchooser->hide_a( );

hide_no_value

$colorchooser->hide_no_value( );

hsv

my $set = $colorchooser->hsv( $h, $s, $v );

hsv2rgb

my @rbg = $colorchooser->hsv2rgb( $h, $s, $v );

layout

$colorchooser->layout( );

new

my $self = $colorchooser->new( $x, $y, $w, $h, $label );

no_value

my $no_val = $colorchooser->no_value( );
my $no_val = $colorchooser->no_value( $value );

r

my $red = $colorchooser->r( );

rgb

my $set = $colorchooser->rgb( $r, $g, $b );

rgb2hsv

my @hsv = $colorchooser->rgb2hsv( $r, $g, $b );

s

my $saturation = $colorchooser->s( );

v

my $v = $colorchooser->v( );

value

my $color = $colorchooser->value( );
my $val = $colorchooser->value( $color );

Author

Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/

License and Legal

Copyright (C) 2008-2010 by Sanko Robinson <sanko@cpan.org>

This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or notes on the Artistic License 2.0 for clarification.

When separated from the distribution, all original POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See the clarification of the CCA-SA3.0.