Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Identify color hex codes in a straight line

Tags:

html

colors

How can I programmatically ascertain the html color hex codes for colors in a single spectral line? I'm definitely using the wrong terminology I'm just not sure how else to phrase it. This picture should bring clarity:

Color Line

Notice how the cursor in the top rectangle is always in the same position. It's simply the cursor in the first bar that moves into different color segments, thus generating the hex codes visible below.

Is it possible to generate these programmatically?

like image 307
Moose Avatar asked Nov 09 '22 14:11

Moose


1 Answers

it would take 3 steps to get there programatically: choose the base color (for each of your screen shots its the right top corner) then lighten it to the the right amount (the X axis of your squares) then darken it to the right amount (the Y axis of your squares) if your'e using precompiled css like SASS it would look like that:

$someColor: red;
$lighten: brighten($someColor,20%);
$darkenedColor : darken($lighten, 32%);

$darkenedColor will get you the point that you are looking for, it will work for any given $someColor

like image 52
David Rubin Avatar answered Nov 15 '22 05:11

David Rubin