Created
October 22, 2022 19:55
-
-
Save oguzhancvdr/b0c8bfc8052802460bbab078471887c3 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 = (r, g, b) => "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1); | |
rgbToHex(255, 255, 255); | |
// #ffffff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Convert RGB to Hex