PHP Class Identicon\Generator\BaseGenerator

Author: Benjamin Laugueux ([email protected])
Show file Open project: yzalis/identicon

Protected Properties

Property Type Description
$backgroundColor array
$color array
$generatedImage mixed
$pixelRatio integer
$size integer

Public Methods

Method Description
getArrayOfSquare ( ) : array
getBackgroundColor ( ) : array Get the background color.
getColor ( ) : array Get the color.
getHash ( ) : string Get the identicon string hash.
getPixelRatio ( ) : integer Get the pixel ratio.
getSize ( ) : integer Get the image size.
setBackgroundColor ( string | array $backgroundColor ) Set the image background color.
setColor ( string | array $color ) Set the image color.
setSize ( integer $size ) Set the image size.
setString ( string $string ) Generate a hash from the original string.

Private Methods

Method Description
convertColor ( array | string $color ) : array
convertHashToArrayOfBoolean ( ) Convert the hash into an multidimensional array of boolean.
convertHexaToBoolean ( string $hexa ) : boolean Convert an hexadecimal number into a boolean.

Method Details

getArrayOfSquare() public method

public getArrayOfSquare ( ) : array
return array

getBackgroundColor() public method

Get the background color.
public getBackgroundColor ( ) : array
return array

getColor() public method

Get the color.
public getColor ( ) : array
return array

getHash() public method

Get the identicon string hash.
public getHash ( ) : string
return string

getPixelRatio() public method

Get the pixel ratio.
public getPixelRatio ( ) : integer
return integer

getSize() public method

Get the image size.
public getSize ( ) : integer
return integer

setBackgroundColor() public method

Set the image background color.
public setBackgroundColor ( string | array $backgroundColor )
$backgroundColor string | array The color in hexa (3 or 6 chars) or rgb array

setColor() public method

Set the image color.
public setColor ( string | array $color )
$color string | array The color in hexa (3 or 6 chars) or rgb array

setSize() public method

Set the image size.
public setSize ( integer $size )
$size integer

setString() public method

Generate a hash from the original string.
public setString ( string $string )
$string string

Property Details

$backgroundColor protected property

protected array $backgroundColor
return array

$color protected property

protected array $color
return array

$generatedImage protected property

protected mixed $generatedImage
return mixed

$pixelRatio protected property

protected int $pixelRatio
return integer

$size protected property

protected int $size
return integer