Overview

Namespaces

  • Jyxo
    • Beholder
      • TestCase
    • Gettext
      • Parser
    • Input
      • Chain
      • Filter
      • Validator
    • Mail
      • Email
        • Attachment
      • Parser
      • Sender
    • Rpc
      • Json
      • Xml
    • Shell
    • Spl
    • Svn
    • Time
    • Webdav
  • PHP

Classes

  • Charset
  • Color
  • Css
  • ErrorHandler
  • ErrorMail
  • FirePhp
  • Html
  • HtmlTag
  • SpamFilter
  • String
  • Timer
  • XmlReader

Exceptions

  • Exception
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated

Class Color

Class representing a RGB color.

Namespace: Jyxo
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