note 87 added to gtk.gtkcolorselection.method.get_color.php
| From: | Andy Chase | Date: | Thu, 24 Jan 2002 07:19:36 +0000 |
| Subject: | note 87 added to gtk.gtkcolorselection.method.get_color.php | ||
| Groups: | php.gtk.webmaster | ||
| Request: | Send a blank email to php-gtk-webmaster+get-245@lists.php.net to get a copy of this message | ||
Returns an array containing the R, G, and B color values (in that order).
The values are decimals between 0 and 1; if you need values between 0 and 255 you'll have to do
something like
<?
function getHexColor($colorPickerName){
$colors = array("Red", "Green", "Blue");
$colorInfo = $$colorPickerName->get_color();
for($index = 0; $index < 3; $index++){
/* (This just dumps to the console, but the reformatted RGB values could easily be stuffed
into another widget or widgets) */
echo $colors[$index] . " = ";
echo floor($colorInfo[$index] * 255);
echo "\n";
}
}
?>
http://gtk.php.net/manual/en/gtk.gtkcolorselection.method.get_color.php