PHP Class Pop\Color\Space\Hex

Author: Nick Sagona, III ([email protected])
Inheritance: implements Pop\Color\Space\ColorInterface
Datei anzeigen Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$blue string Blue value
$green string Green value
$hex string Hex value
$red string Red value
$shorthand string Shorthand hex value

Public Methods

Method Description
__construct ( string $hex ) : Hex Constructor
__toString ( ) : string Method to return the string value for printing output.
get ( integer $type = Pop\Color\Color::STRING, boolean $hash = false, boolean $short = false ) : string Method to get the full RGB hex value
getBlue ( ) : integer Method to get the blue hex value
getGreen ( ) : integer Method to get the green hex value
getRed ( ) : integer Method to get the red hex value

Protected Methods

Method Description
isValid ( ) : boolean Method to determine if the hex value is valid.

Method Details

__construct() public method

Instantiate the hex color object
public __construct ( string $hex ) : Hex
$hex string
return Hex

__toString() public method

Method to return the string value for printing output.
public __toString ( ) : string
return string

get() public method

Method to get the full RGB hex value
public get ( integer $type = Pop\Color\Color::STRING, boolean $hash = false, boolean $short = false ) : string
$type integer
$hash boolean
$short boolean
return string

getBlue() public method

Method to get the blue hex value
public getBlue ( ) : integer
return integer

getGreen() public method

Method to get the green hex value
public getGreen ( ) : integer
return integer

getRed() public method

Method to get the red hex value
public getRed ( ) : integer
return integer

isValid() protected method

Method to determine if the hex value is valid.
protected isValid ( ) : boolean
return boolean

Property Details

$blue protected_oe property

Blue value
protected string $blue
return string

$green protected_oe property

Green value
protected string $green
return string

$hex protected_oe property

Hex value
protected string $hex
return string

$red protected_oe property

Red value
protected string $red
return string

$shorthand protected_oe property

Shorthand hex value
protected string $shorthand
return string