If you need a quick manual conversion - you can simply ignore everything what comes after ..
Or you can use:
Math.round(0.30*255).toString(16)// 4d, rounds up for >=.5Math.floor(0.30*255).toString(16)// 4c, rounds downMath.ceil(0.30*255).toString(16)// 4d, rounds up
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great tip. But an issue to this approach is fractional values
So I have to be careful when using this technique to setting up dynamic color values in something like generating css using js params.
Rounding up hexadecimal values is a tricky business....
If you need a quick manual conversion - you can simply ignore everything what comes after
.
.Or you can use: