UNPKG
covertrbgtohex
Version:
latest (1.0.0)
1.0.0
this library covert RBG to HEX
covertrbgtohex
/
covertRBGtoHex.js
12 lines
(9 loc)
•
212 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
const
covert
= (
...num
) => {
const
a = num.
map
(
value
=>
{
const
hex = value.
toString
(
16
);
return
hex.
length
===
1
?
"0"
+ hex : hex; })
return
'#'
+ a.
join
(
''
); }
export
default
covert
// test