Jump to content

How can I modify a HEX color code, using a range of 0 to 100, where 0=white, ...


physaux

Recommended Posts

How can I change a hex color code by a percent?

 

Ex= [008E00-->ffffff] is proportional to [100-->0]?

 

What I mean is like, imagine the following line (or color gradient):

ffffff____________________008E00

 

Where white is at far left, and a shade of green is on far right. Now Imagine another line, right under that line:

0______________________100

 

I want a way of generating a hex color code, based on a number between 0 and 100.

0 would be WHITE

100 would be MY GREEN

 

My theory is to just focus on the green component of the hex, 8E, then construct a hex code of that, by surrounding ti with two zeros on each side. So I guess my question comes down to how do I get a percentage of a hex number (I don't know much about hex numbers)...

 

Thanks!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.