Created
December 8, 2016 07:49
-
-
Save BOSSoNe0013/f6db0c70f2508402182b438ca0a5fbb2 to your computer and use it in GitHub Desktop.
Parse css rgb color with javascript
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
var css = 'rgb(128,128,128)'; | |
var channels={}; | |
[channels.red, channels.green, channels.blue] = css.replace(/[rgb\(\) ]/g, '').split(','); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment