VihvLCC  3.0.0
Color Class Reference

Public Member Functions

 __construct ($hexRGB)
 
 hexRgbToArray ($hexRGB)
 
 toNice ()
 
 fromNice ($lsf)
 
 getIntensity ()
 
 getChroma ()
 
 addChroma ($value)
 
 incChroma ()
 
 doubleGreen ()
 
 fixGreen ()
 
 getSaturation ()
 
 getLuminosity ()
 
 getHue ()
 
 getNormalizedRgb ()
 
 arrayToHex ($array)
 
 toHsl ()
 
 toHexHsl ()
 
 toRgb ()
 
 toHexRgb ()
 
 hslToRgb ($h, $s, $l)
 

Constructor & Destructor Documentation

__construct (   $hexRGB)

Member Function Documentation

addChroma (   $value)
arrayToHex (   $array)
doubleGreen ( )
fixGreen ( )
fromNice (   $lsf)
getChroma ( )
Returns
float [0..1]
getHue ( )
getIntensity ( )
Returns
intensity of color

intensity = 85 for 255,0,0 (max red) intensity = 85 for 127,128,0 (yellow) intensity = 170 for 255,255,0 (max yellow) intensity = 255 for 255,255,255 (pure white)

getLuminosity ( )
getNormalizedRgb ( )
Returns
array of color values divided by 255
getSaturation ( )

hue rely on hexadon, we will rely on triandle, so intensity will be always the same

hexRgbToArray (   $hexRGB)
hslToRgb (   $h,
  $s,
  $l 
)
incChroma ( )

a few tips

  1. we are trying to use colors of same intensity, however if we start with color like (255,255,0) intensity is MORE than 255. (510,0,0) is impossible, so we king of cut extra values during toHexRgb
  2. pure green (0, 255, 0) looks brighter than (255, 0, 0) or (0,0,255) so there is function fixGreen. It cut green channel in half
toHexHsl ( )
toHexRgb ( )
toHsl ( )
toNice ( )
toRgb ( )

The documentation for this class was generated from the following file: