Overview

Packages

  • Jyxo_Beholder
  • Jyxo_Charset
  • Jyxo_Color
  • Jyxo_Css
  • Jyxo_ErrorHandling
  • Jyxo_FirePhp
  • Jyxo_Gettext
    • Parser
  • Jyxo_Html
  • Jyxo_Input
    • Chain
    • Filter
    • Validator
  • Jyxo_Mail
    • Email
    • Parser
    • Sender
  • Jyxo_Rpc
    • Json
    • Xml
  • Jyxo_Shell
  • Jyxo_SpamFilter
  • Jyxo_Spl
  • Jyxo_String
  • Jyxo_Svn
  • Jyxo_Time
  • Jyxo_Timer
  • Jyxo_Webdav
  • Jyxo_XmlReader
  • PHP

Classes

  • Jyxo_Color
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class Jyxo_Color

Class representing a RGB color.

Category: Jyxo
Package: Jyxo_Color
Copyright: Copyright (c) 2005-2011 Jyxo, s.r.o.
License: https://github.com/jyxo/php/blob/master/license.txt
Author: Roman Řáha
Located at Color.php
Methods summary
public
# __construct( mixed $color = null )

Constructor.

Constructor.

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,
  • Jyxo_Color,
  • null

Parameters

$color
mixed
Color definition
public Jyxo_Color
# toInverse( )

Returns an inverse color.

Returns an inverse color.

Returns

Jyxo_Color
public Jyxo_Color
# toGrayScale( )

Returns the currect color converted to grayscale.

Returns the currect color converted to grayscale.

Returns

Jyxo_Color
public string
# __toString( )

Returns textual (#RRGGBB) representation of the current color.

Returns textual (#RRGGBB) representation of the current color.

Returns

string
public array
# getRgb( )

Returns the current color as an array of the red, green and blue components.

Returns the current color as an array of the red, green and blue components.

Returns

array
public string
# getHex( )

Returns the current color as a six-digit hexadecimal number.

Returns the current color as a six-digit hexadecimal number.

Returns

string
public integer
# getBinary( )

Returns the current color in binary form 0 - black, 1 - white).

Returns the current color in binary form 0 - black, 1 - white).

Returns

integer
public integer
# getRed( )

Returns the red component luminance.

Returns the red component luminance.

Returns

integer
public Jyxo_Color
# setRed( integer|string $red )

Sets the red component luminance.

Sets the red component luminance.

Parameters

$red
integer|string
Component luminance

Returns

Jyxo_Color
public integer
# getGreen( )

Returns the green component luminance.

Returns the green component luminance.

Returns

integer
public Jyxo_Color
# setGreen( integer|string $green )

Sets the green component luminance.

Sets the green component luminance.

Parameters

$green
integer|string
Component luminance

Returns

Jyxo_Color
public integer
# getBlue( )

Returns the blue component luminance.

Returns the blue component luminance.

Returns

integer
public Jyxo_Color
# setBlue( integer|string $blue )

Sets the blue component luminance.

Sets the blue component luminance.

Parameters

$blue
integer|string
Component luminance

Returns

Jyxo_Color
public integer
# getLuminance( )

Returns the color luminance according to the human perception.

Returns the color luminance according to the human perception.

Returns

integer
public Jyxo_Color
# setLuminance( integer|string $luminance )

Sets the color in grayscale according to the luminance value.

Sets the color in grayscale according to the luminance value.

Parameters

$luminance
integer|string
Luminance

Returns

Jyxo_Color
Constants summary
integer LUM_MIN 0x00
#

Minimal luminance.

Minimal luminance.

integer LUM_MAX 0xFF
#

Maximal luminance.

Maximal luminance.

Jyxo PHP Library API documentation generated by ApiGen 2.3.0