NAME

Graphics::ColorDeficiency - Color Deficiency Simulation

SYNOPSIS

use Graphics::ColorDeficiency;

my $col = Graphics::ColorDeficiency->newRGB(0.5, 0.7, 1);

my $col2 = $col->asProtanopia;

print $col2->asHex;

DESCRIPTION

This module allows easy transformation of colors for color deficiency simulation. All the known and theorhetical color deficiencies are represented here, with the exception of 4-cone vision (tetrachromatism).

Each of the transformation methods returns a Graphics::ColorObject object, with the internal color values set. This can then be used to return the color in many different formats (see the Graphics::ColorObject manpage).

METHODS

asProtanopia()
asDeutanopia()
asTritanopia()

The three dichromat methods return a Graphics::ColorObject object, simulated for the three dichromatic vision modes.

asProtanomaly( $amount )
asDeuteranomaly( $amount )
asTritanomaly( $amount )

The three anomalous trichromat methods return a Graphics::ColorObject object, simulated for the three anomalous trichromatic vision modes. The optional $amount agrument allows you to specify the severity of anomaly, ranging from 0 (trichromatic) to 1 (dichromatic). If not specified, it defaults to 0.5.

asTypicalMonochrome()

Returns a Graphics::ColorObject object in Typical Monochromatic (Rod Monochromat) mode.

asAtypicalMonochrome( $amount )

Returns a Graphics::ColorObject object in Atypical Monochromatic (Cone Monochromat) mode. The amount specified in $amount can vary between 1 (trichromatic) and 0 (monochromatic). The default is 0.2 (four fifths gray).

Clone()

Clones the current object, returning a Graphics::ColorDeficiency object with the same color values as the current object.

asMix( $color, $amount )

Returns a new Graphics::ColorDeficiency, consisting of the current color values, mixed with the values of the $color object. $amount specifies the amount of the new color to mix in, from 0 (which is equal to $self.Clone()), up to 1 (which is equal to $color.Clone()). The mix is a linear RGB interpolation.

This method is used internally.

AUTHOR

Copyright (C) 2003 Cal Henderson <cal@iamcal.com>

SEE ALSO

Graphics::ColorObject

http://www.iamcal.com/toys/colors/