Skip to content

Commit 1a263d0

Browse files
Merge pull request #179 from ChaymaJaziri/patch-2
HexToRGB
2 parents 3a7df56 + f5054ac commit 1a263d0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Conversions/HexToRGB

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function hexStringToRGB(hexString) {
2+
var r=(hexString.substring(1,3)).toUpperCase()
3+
var g=hexString.substring(3,5).toUpperCase()
4+
var b=hexString.substring(5,7).toUpperCase()
5+
6+
r=parseInt(r,16)
7+
g=parseInt(g,16)
8+
b=parseInt(b,16)
9+
var obj={r, g, b}
10+
11+
return obj
12+
}

0 commit comments

Comments
 (0)