PHP Class Craft\Imager_ColorService

Inheritance: extends craft\BaseApplicationComponent
Datei anzeigen Open project: aelvan/Imager-Craft Class Usage Examples

Public Methods

Method Description
__construct ( ) Constructor
getColorPalette ( craft\AssetFileModel | string $image, $colorCount, $quality, $colorValue ) : array Gets color palette for image
getDominantColor ( craft\AssetFileModel | string $image, $quality, $colorValue ) : boolean | string Get dominant color of image
hex2rgb ( string $hex ) : array Convert hex color to rgb
rgb2hex ( array $rgb ) : string Convert rgb color to hex

Private Methods

Method Description
_paletteToHex ( $palette ) : array Convert palette to array of hex colors

Method Details

__construct() public method

Constructor
public __construct ( )

getColorPalette() public method

Gets color palette for image
public getColorPalette ( craft\AssetFileModel | string $image, $colorCount, $quality, $colorValue ) : array
$image craft\AssetFileModel | string
$colorCount
$quality
$colorValue
return array

getDominantColor() public method

Get dominant color of image
public getDominantColor ( craft\AssetFileModel | string $image, $quality, $colorValue ) : boolean | string
$image craft\AssetFileModel | string
$quality
$colorValue
return boolean | string

hex2rgb() static public method

Convert hex color to rgb
static public hex2rgb ( string $hex ) : array
$hex string
return array

rgb2hex() static public method

Convert rgb color to hex
static public rgb2hex ( array $rgb ) : string
$rgb array
return string