Toggle navigation
VR AR News
beta
Blog
Suggest a feed
Feedback
About
Monday, 23 March, 2020
UTC
javascript: Create a Function to Convert JS Numbers into CSS Hex Colors
Summary
JavaScript numbers and CSS hexadecimal numbers don't play very well together. You can solve this with a conversion function that takes the number, converts it to a string, then pads the string with the necessary zeroes at the start using `padStart`.
... more @ egghead.io
egghead.io