GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Imager::Color::Float(3) User Contributed Perl Documentation Imager::Color::Float(3)

Imager::Color::Float - Rough floating point sample color handling

  $color = Imager::Color->new($red, $green, $blue);
  $color = Imager::Color->new($red, $green, $blue, $alpha);
  $color = Imager::Color->new("#C0C0FF"); # html color specification

  $color->set($red, $green, $blue);
  $color->set($red, $green, $blue, $alpha);
  $color->set("#C0C0FF"); # html color specification

  ($red, $green, $blue, $alpha) = $color->rgba();
  @hsv = $color->hsv(); # not implemented but proposed

  $color->info();

This module handles creating color objects used by Imager. The idea is that in the future this module will be able to handle color space calculations as well.

A floating point Imager color consists of up to four components, each in the range 0.0 to 1.0. Unfortunately the meaning of the components can change depending on the type of image you're dealing with:

  • for 3 or 4 channel images the color components are red, green, blue, alpha.
  • for 1 or 2 channel images the color components are gray, alpha, with the other two components ignored.

An alpha value of zero is fully transparent, an alpha value of 1.0 is fully opaque.

new
This creates a color object to pass to functions that need a color argument.
set
This changes an already defined color. Note that this does not affect any places where the color has been used previously.
rgba()
This returns the red, green, blue and alpha channels of the color the object contains.
info
Calling info merely dumps the relevant color to the log.
red
green
blue
alpha
Returns the respective component as a floating point value typically from 0 to 1.0.

Arnar M. Hrafnkelsson, addi@umich.edu And a great deal of help from others - see the "README" for a complete list.

Imager(3), Imager::Color.

http://imager.perl.org/

2020-06-13 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.