note 91753 added to function.hexdec

From: Date: Wed, 24 Jun 2009 17:10:25 +0000
Subject: note 91753 added to function.hexdec
Groups: php.notes 
Request: Send a blank email to php-notes+get-157427@lists.php.net to get a copy of this message
passe valores HEX para RGB útil para passar cores utilizadas na css em HEX para RGB utilização echo hex2rgb('FFFFFF');// saída 255,255,255 echo hex2rgb('FFFFFF','rgb');// saída array(r=>255,g=>255,b=>255) function hex2rgb($hex, $rgb) { $int = hexdec($hex); switch($rgb) { case "r": return 0xFF & $int >> 0x10; break; case "g": return 0xFF & ($int >> 0x8); break; case "b": return 0xFF & $int; break; case "rgb": return array( "r" => 0xFF & $int >> 0x10, "g" => 0xFF & ($int >> 0x8), "b" => 0xFF & $int ); break; default: $_rgb .= 0xFF & $int >> 0x10; $_rgb .= ','; $_rgb .= 0xFF & ($int >> 0x8); $_rgb .= ','; $_rgb .= 0xFF & $int; return $_rgb; break; } } ---- Server IP: 69.147.83.197 Probable Submitter: 189.60.58.45 ---- Manual Page -- http://www.php.net/manual/en/function.hexdec.php Edit -- https://master.php.net/note/edit/91753 Del: integrated -- https://master.php.net/note/delete/91753/integrated Del: useless -- https://master.php.net/note/delete/91753/useless Del: bad code -- https://master.php.net/note/delete/91753/bad+code Del: spam -- https://master.php.net/note/delete/91753/spam Del: non-english -- https://master.php.net/note/delete/91753/non-english Del: in docs -- https://master.php.net/note/delete/91753/in+docs Del: other reasons-- https://master.php.net/note/delete/91753 Reject -- https://master.php.net/note/reject/91753 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#157427) next »