Created
June 11, 2018 23:44
-
-
Save lukejacksonn/a3486fc2fb768dc7e2dd2b9d724c4406 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rgbToHex = rgb => | |
'#' + rgb | |
.match(/rgb\((\d*), (\d*), (\d*)\)/) | |
.slice(1,4) | |
.map(d => Number(d).toString(16).padStart(2, '0')) | |
.join('') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment