phpbar.de logo

Mailinglisten-Archive

[php] Farben umwandeln...

[php] Farben umwandeln...

Michael Siebert fallen at webbuildersnet.de
Don Jul 1 22:58:01 CEST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Donnerstag 01 Juli 2004 22:48 schrieb Michael Schoenboeck:
> > > function hex2long($hex){
> > > 	$r = hexdec(substr($hex, 0, 2))
> > > 	$g = hexdec(substr($hex, 2, 2))
> > > 	$b = hexdec(substr($hex, 4, 2))
> > > 	return($r*$g*$b)
> > > }
> Ok, so weit wars mir klar, das da nix rauskommt, nur wie kommt was raus? ;)

function hex2long($hex){
 	$r = hexdec(substr($hex, 0, 2)) << 16
 	$g = hexdec(substr($hex, 2, 2)) << 8
 	$b = hexdec(substr($hex, 4, 2))
 	
	return $r & $g & $b;
}

habs nich gesteste, sollte aber gehn

- -- 
MfG
 Michael Siebert
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA5HrZao3uR0c9690RAov/AJwLY15PoK/lz+ESLKwEh9u1N/HFkQCdFPwG
uXdh64ptiiqj0WBenOhoIEI=
=X71I
-----END PGP SIGNATURE-----

php::bar PHP Wiki   -   Listenarchive