Warning: Invalid argument supplied for foreach() in /home/jihswbiz/public_html/t6.gwilt.org/refDox.php on line 212
Docs-colorsRGBtoLin

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  colorsRGBtoLin   Lines 656-668 (12 lines)Added: 2021-02-19 file  utils.php   Last mod: Fri 2021-05-14 21:45:07

function colorsRGBtoLin $chan )
        {
#-k     color
#-      Send this function a decimal sRGB gamma encoded color value between 0.0 and 1.0
#-p     $chan   - req   - color channel, 0-255
#-p             - ret   - a linearized value.
#-c     Myindex response 2019-06-19 on https://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color
#-d     2/19/21 - Added

        
if ( $chan <= 0.04045 ) { return $chan 12.92; }
        else                    { return 
pow(( $chan 0.055)/1.055,2.4); }
        }

?>