D
darrel
(apologies if I've asked this before in here...I thought I had, but can't
seem to find my original post).
I'm trying to automate the process of picking some colors. I want to select
one color, then programtically generate some different values of the same
color...both lighter and darker.
I'd like to start and end with a hex value.
Can that be done in VB.net? It looks like I can, but the hex values I see in
examples don't quite match the typical hex notation of color values in CSS.
For instance, I'd like to take this:
#6699cc
Split it into 3 values (easy enough) and convert to a percentage value (not
sure on that step, but basically 'hex converted to base 10/255'):
66 = .4
99 = .6
cc = .8
Then do some math on each (like multiply by 1.2 to make a ligher color) and
then convert back to hex.
It looks like hex is a type of LONG, but I'm not exactly sure how to
translate between the two. Is ctype the answer?
-Darrel
seem to find my original post).
I'm trying to automate the process of picking some colors. I want to select
one color, then programtically generate some different values of the same
color...both lighter and darker.
I'd like to start and end with a hex value.
Can that be done in VB.net? It looks like I can, but the hex values I see in
examples don't quite match the typical hex notation of color values in CSS.
For instance, I'd like to take this:
#6699cc
Split it into 3 values (easy enough) and convert to a percentage value (not
sure on that step, but basically 'hex converted to base 10/255'):
66 = .4
99 = .6
cc = .8
Then do some math on each (like multiply by 1.2 to make a ligher color) and
then convert back to hex.
It looks like hex is a type of LONG, but I'm not exactly sure how to
translate between the two. Is ctype the answer?
-Darrel