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!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.