In my CSS, I defined the #error div as:
#error {
border-width:1px;
border-style:solid;
border-color: #DD3C10;
background:#FFEBE8;
/* Other settings */
}
The code above isn’t mine, actually – I used the same colors as Facebook. Now, I want to do the same with the #success div, but I don’t know which colors to use. I want to keep the same tint (which is, the position on the line between “full color” and “white”), but of green instead of red. How do I do it? Is there a “formula”?
You care about the L (lightness) component in the HSL representation of your color. You can find an online converter (RGB/HEX to HSL) here: little link.
HSL for
#DD3C10is13° 86% 46%, while#FFEBE8is8° 100% 95%. Difference in lightness is, as you see,49%.Suppose your green for
borderis#00FF00, which is120° 100% 50%in HSL. To calculate the new lightness component, just add49%. Thus the green forbackgroundis120° 100% 99%which is#FAFFFA.