We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

jatkins on 06/26/08


Tagged

php binary colours colour color colors


Versions (?)


Who likes this?

3 people have marked this snippet as a favorite

not_skeletor
SpinZ
brent-man


PHP Binary colours


Published in: PHP 


Pretty pointless.

  1. <?php
  2. function binary_colours($rgb) {
  3. $r = bindec(substr($rgb,0,8));
  4. $g = bindec(substr($rgb,8,8));
  5. $b = bindec(substr($rgb,16,8));
  6. return "color: rgb($r,$g,$b);";
  7. }
  8. echo "<h3 style=\"".binary_colours("000000001111111100000000")."\">Hello</h3>";
  9. ?>

Report this snippet 

You need to login to post a comment.