-
-
Save anonymous/7ff0074175d48cb6acd7 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
def hex_to_rgb(hex) | |
r = hex.slice(1..2).to_i(16) | |
g = hex.slice(3..4).to_i(16) | |
b = hex.slice(5..6).to_i(16) | |
"#{r}, #{g}, #{b}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment