Last active
November 1, 2019 10:10
-
-
Save tanjo/77fb4a1b4c3d8258ee4cbad17cdc65b3 to your computer and use it in GitHub Desktop.
rgb(0, 1, 2) から HEX に変換するスクリプト
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
["rgb(0, 1, 2)", "rgb(0, 1, 2)", "rgb(0, 1, 2)", "rgb(0, 1, 2)", "rgb(0, 1, 2)"] | |
.map((e) => "#" + e.style.borderTopColor | |
.replace(/rgb/g, '') | |
.replace(/\(/g,'') | |
.replace(/\)/g,'') | |
.replace(/ /g,'') | |
.split(',') | |
.map((e) => ("0" + parseInt(e).toString(16)).slice(-2)) | |
.join('')) | |
.join(" "); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment