Created
February 8, 2022 20:29
-
-
Save chrdek/4c2e7d8853174bd0e88499ee9948ec95 to your computer and use it in GitHub Desktop.
RGB Color to Hexadecimal counterpart in js
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
rgb2hex = s => s.match(/[0-9]+/g).reduce((x,y) => x + (y|256).toString(16).slice(1),'0x'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment