public
|
#
__construct( integer $r = 0, integer $g = 0, integer $b = 0, integer $a = 0 )
construct new color object
construct new color object
Parameters
- $r
integer $r red channel
- $g
integer $g green channel
- $b
integer $b blue channel
- $a
integer $a alpha channel
|
public
boolean
|
#
isValidChannelValue( integer $value, string $channel )
Check if the given value is valid for the given channel name
Check if the given value is valid for the given channel name
Parameters
- $value
integer $value
- $channel
string $channel on of the following : - RGBColor::CHANNEL_RED -
RGBColor::CHANNEL_GREEN, - RGBColor::CHANNEL_BLUE, - RGBColor::CHANNEL_ALPHA,
Returns
boolean
Throws
InvalidArgumentException if the channel name is not supported
|
public
boolean
|
#
isOpaque( )
Checks if the current color is opaque
Checks if the current color is opaque
Returns
boolean true if opaque , false otherwise
|
public
boolean
|
#
isTransparent( )
Checks if the current color is transparent
Checks if the current color is transparent
Returns
boolean true if transparent , false otherwise
|
public
Jaguar\Color\RGBColor
|
#
setAlpha( integer $alpha )
set alpha value
Parameters
- $alpha
integer $alpha in range (0,255)
Returns
Throws
InvalidArgumentException
|
public
integer
|
#
getAlpha( )
Get alpha value
Returns
integer
|
public
Jaguar\Color\RGBColor
|
#
setRed( integer $value )
Set red value
Parameters
- $value
integer $value in range (0,255)
Returns
Throws
InvalidArgumentException
|
public
integer
|
#
getRed( )
Get red value
Returns
integer
|
public
Jaguar\Color\RGBColor
|
#
setGreen( integer $value )
Set green value
Parameters
- $value
integer $value in range (0,255)
Returns
Throws
InvalidArgumentException
|
public
integer
|
#
getGreen( )
Get green value
Returns
integer
|
public
Jaguar\Color\RGBColor
|
#
setBlue( integer $value )
Set blue value
Parameters
- $value
integer $value in range (0,255)
Returns
Throws
InvalidArgumentException
|
public
integer
|
#
getBlue( )
Get blue value
Returns
integer
|
public
integer
|
#
getValue( )
Get color value
Returns
integer
|
public
Jaguar\Color\RGBColor
|
#
setFromRGBColor( Jaguar\Color\RGBColor $color )
Set color from another color object
Set color from another color object
Parameters
Returns
|
public
Jaguar\Color\RGBColor
|
#
setFromArray( array $color )
Set color from array
Parameters
- $color
array $color array with (red,green,blue,alpha) values
Returns
|
public
Jaguar\Color\RGBColor
|
#
setFromValue( integer $rgb, boolean $hasalpha = true )
Set color from rgb integer
Set color from rgb integer
Parameters
- $rgb
integer $rgb
- $hasalpha
boolean $hasalpha true if the rgb contains the alpha and false if not
Returns
|
public
Jaguar\Color\RGBColor
|
#
setFromHex( string $hex, integer $alpha = 0 )
Set color from hex string
Set color from hex string
Parameters
- $hex
string $hex color in hex format
- $alpha
integer $alpha alpha value
Returns
|
public
Jaguar\Color\RGBColor
|
#
getRGBColor( )
Get new color object which is equal to the current one
Get new color object which is equal to the current one
Returns
|
public
Jaguar\Color\RGBColor
|
#
dissolve( integer $alpha )
incrementing the alpha channel by the given amount
incrementing the alpha channel by the given amount
Parameters
Returns
|
public
Jaguar\Color\RGBColor
|
#
brighter( float $shade = 0.7 )
Create Brighter version of the current color using the specified number of
shades
Create Brighter version of the current color using the specified number of
shades
Parameters
- $shade
float shade default 0.7
Returns
|
public
Jaguar\Color\RGBColor
|
#
darker( float $shade = 0.7 )
Create darker version of the current color using the specified number of
shades
Create darker version of the current color using the specified number of
shades
Parameters
- $shade
float shade default 0.7
Returns
|
public
Jaguar\Color\RGBColor
|
#
blend( Jaguar\Color\RGBColor $color, float $amount )
Blend current color with the given new color and the amount
Blend current color with the given new color and the amount
Parameters
- $color
Jaguar\Color\RGBColor
$color another color
- $amount
float $amount The amount of curennt color in the given color
Returns
|
public
Jaguar\Color\RGBColor
|
#
grayscale( )
Gray current color
Returns
|
public
string
|
#
__toString( )
Get string representation for the current color object
Get string representation for the current color object
Returns
string
Overrides
|
public static
|
#
fromValue( mixed $rgb, mixed $hasalpha = true )
|
public static
|
#
fromHex( mixed $hex, mixed $alpha = 0 )
|
public static
|
#
fromArray( array $color )
|