PHP Class Phue\Helper\ColorConversion

Show file Open project: sqmk/phue Class Usage Examples

Public Methods

Method Description
convertRGBToXY ( integer $red, integer $green, integer $blue ) : array Converts RGB values to XY values Based on: http://stackoverflow.com/a/22649803
convertXYToRGB ( float $x, float $y, integer $bri = 255 ) : array Converts XY (and brightness) values to RGB

Method Details

convertRGBToXY() public static method

Converts RGB values to XY values Based on: http://stackoverflow.com/a/22649803
public static convertRGBToXY ( integer $red, integer $green, integer $blue ) : array
$red integer Red value
$green integer Green value
$blue integer Blue value
return array x, y, bri key/value

convertXYToRGB() public static method

Converts XY (and brightness) values to RGB
public static convertXYToRGB ( float $x, float $y, integer $bri = 255 ) : array
$x float X value
$y float Y value
$bri integer Brightness value
return array red, green, blue key/value