quailColorTest Class Reference

Inherits quailTest.

Inherited by bodyColorContrast, bodyWaiErtColorContrast, and cssTextHasContrast.

Collaboration diagram for quailColorTest:
[legend]

List of all members.

Public Member Functions

 getLuminosity ($foreground, $background)
 luminosity ($r, $r2, $g, $g2, $b, $b2)
 getRGB ($color)
 convertColor ($color)
 getWaiErtContrast ($foreground, $background)
 getWaiErtBrightness ($foreground, $background)


Detailed Description

Helper test base for tests dealing with color difference and luminosity.

Definition at line 623 of file test.php.


Member Function Documentation

quailColorTest::convertColor ( color  ) 

Converts multiple color or backround styles into a simple hex string

Parameters:
string $color The color attribute to convert (this can also be a multi-value css background value)
Returns:
string A standard CSS hex value for the color

Definition at line 842 of file test.php.

Referenced by getRGB().

quailColorTest::getLuminosity ( foreground,
background 
)

Helper method that finds the luminosity between the provided foreground and background parameters.

Parameters:
string $foreground The HEX value of the foreground color
string $background The HEX value of the background color
Returns:
float The luminosity contrast ratio between the colors

Definition at line 775 of file test.php.

References getRGB(), and luminosity().

Referenced by bodyColorContrast::check(), and cssTextHasContrast::check().

quailColorTest::getRGB ( color  ) 

Returns the decimal equivalents for a HEX color

Parameters:
string $color The hex color value
Returns:
array An array where 'r' is the Red value, 'g' is Green, and 'b' is Blue

Definition at line 827 of file test.php.

References convertColor().

Referenced by getLuminosity(), getWaiErtBrightness(), and getWaiErtContrast().

quailColorTest::getWaiErtBrightness ( foreground,
background 
)

Returns the WAI ERT Brightness between two colors

Definition at line 906 of file test.php.

References getRGB().

Referenced by bodyWaiErtColorContrast::check().

quailColorTest::getWaiErtContrast ( foreground,
background 
)

Returns the WAIERT contrast between two colors

See also:
GetLuminosity

Definition at line 894 of file test.php.

References getRGB().

Referenced by bodyWaiErtColorContrast::check().

quailColorTest::luminosity ( r,
r2,
g,
g2,
b,
b2 
)

Returns the luminosity between two colors

Parameters:
string $r The first Red value
string $r2 The second Red value
string $g The first Green value
string $g2 The second Green value
string $b The first Blue value
string $b2 The second Blue value
Returns:
float The luminosity contrast ratio between the colors

Definition at line 794 of file test.php.

Referenced by getLuminosity().


The documentation for this class was generated from the following file:

Generated on Sat Aug 21 08:55:12 2010 for QUAIL Accessibility Information library by  doxygen 1.5.7.1