PHP 클래스 Jyxo\Color

저자: Roman Řáha
파일 보기 프로젝트 열기: jyxo/php

공개 메소드들

메소드 설명
__construct ( mixed $color = null ) Constructor.
__toString ( ) : string Returns textual (#RRGGBB) representation of the current color.
getBinary ( ) : integer Returns the current color in binary form 0 - black, 1 - white).
getBlue ( ) : integer Returns the blue component luminance.
getGreen ( ) : integer Returns the green component luminance.
getHex ( ) : string Returns the current color as a six-digit hexadecimal number.
getLuminance ( ) : integer Returns the color luminance according to the human perception.
getRed ( ) : integer Returns the red component luminance.
getRgb ( ) : array Returns the current color as an array of the red, green and blue components.
setBlue ( integer | string $blue ) : self Sets the blue component luminance.
setGreen ( integer | string $green ) : self Sets the green component luminance.
setLuminance ( integer | string $luminance ) : self Sets the color in grayscale according to the luminance value.
setRed ( integer | string $red ) : self Sets the red component luminance.
toGrayScale ( ) : self Returns the currect color converted to grayscale.
toInverse ( ) : self Returns an inverse color.

비공개 메소드들

메소드 설명
initFromHex ( string $hex ) : self Sets color components using a hexadecimal RRGGBB string.
initFromInt ( integer $int ) : self Sets color components from an integer.
initFromRgb ( array $rgb ) : self Sets color components from an array.
toInt ( integer | string $value ) : integer Returns the color luminance as a decimal integer.

메소드 상세

__construct() 공개 메소드

Accepts the following definition formats: * Hexadecimal string (with or without the hashmark at the beginning) * Array with red, green and blue component luminance values (in this order) * Number, * {@link \Jyxo\Color}, * null
public __construct ( mixed $color = null )
$color mixed Color definition

__toString() 공개 메소드

Returns textual (#RRGGBB) representation of the current color.
public __toString ( ) : string
리턴 string

getBinary() 공개 메소드

Returns the current color in binary form 0 - black, 1 - white).
public getBinary ( ) : integer
리턴 integer

getBlue() 공개 메소드

Returns the blue component luminance.
public getBlue ( ) : integer
리턴 integer

getGreen() 공개 메소드

Returns the green component luminance.
public getGreen ( ) : integer
리턴 integer

getHex() 공개 메소드

Returns the current color as a six-digit hexadecimal number.
public getHex ( ) : string
리턴 string

getLuminance() 공개 메소드

Returns the color luminance according to the human perception.
public getLuminance ( ) : integer
리턴 integer

getRed() 공개 메소드

Returns the red component luminance.
public getRed ( ) : integer
리턴 integer

getRgb() 공개 메소드

Returns the current color as an array of the red, green and blue components.
public getRgb ( ) : array
리턴 array

setBlue() 공개 메소드

Sets the blue component luminance.
public setBlue ( integer | string $blue ) : self
$blue integer | string Component luminance
리턴 self

setGreen() 공개 메소드

Sets the green component luminance.
public setGreen ( integer | string $green ) : self
$green integer | string Component luminance
리턴 self

setLuminance() 공개 메소드

Sets the color in grayscale according to the luminance value.
public setLuminance ( integer | string $luminance ) : self
$luminance integer | string Luminance
리턴 self

setRed() 공개 메소드

Sets the red component luminance.
public setRed ( integer | string $red ) : self
$red integer | string Component luminance
리턴 self

toGrayScale() 공개 메소드

Returns the currect color converted to grayscale.
public toGrayScale ( ) : self
리턴 self

toInverse() 공개 메소드

Returns an inverse color.
public toInverse ( ) : self
리턴 self