In CSS, linear gradient css looks like:
background-image: linear-gradient(blue, lightblue);
This starts the gradient at blue, and ends at lightblue. Not actually pretty, but it serves as an example.
Now, what if you only have the start color? What if you start with a passed parameter for color (imagine it's passed in an MVC ViewModel)? For example, you may have been passed a value of 'red', and you would like to have a linear gradient from that starting 'red' to some subtly lighter color of red to make a nice gradient?
Would you need to know, or convert, 'red' into hex values, and then generate the gradient stop color by manipulation of the hex number? Is there a 'normal' way to do this? Ie
- some trick to convert 'red' to a hex value like #A11634
- some trick to apply some math to 'make A11634 a subtly lighter color'?
OR
- some gradient trick to automagically create a gradient with one color, to a lighter version of that color?