Day dreaming about automatic RGB color function in PHP
Posted
by
Sam
on Stack Overflow
See other posts from Stack Overflow
or by Sam
Published on 2011-02-23T23:23:16Z
Indexed on
2011/02/23
23:25 UTC
Read the original article
Hit count: 313
Hello fellow earthlings. A quesion about RGB color and its usefulness in a simple tiny php code:
Imagine I have variable $colorA
containning a valid six char color. say B1B100
, a greenish natural color. Now If I would like to make a new color from that, which is, say, ten steps lighter thatn that original color, roughly.
$colorA = B1B100 // original color
php code with little color engine lightening stuff up goes here
$colorB = ?????? // original color lightened up
Is there a php ready function that KNOWS rgb colors something like
php function RGB ( input color, what to do, output color) Where what to do could be +/- 255 values of brightness etc etc.
Is something like this already possible or am I day dreaming?
rgb($colorA, +10, $colorB)
If this does not exist, what would be the shortest code for doing this? Link suffices. Suggestions and ideas are answers to me. Thanks.
© Stack Overflow or respective owner