UNPKG
ade-planning-api
Version:
latest (1.0.4)
1.0.4
1.0.3
1.0.2
1.0.1
An unofficial API wrapper for ADE Planning from Adesoft
ade-planning-api
/
src
/
utils
/
color.ts
11 lines
(8 loc)
•
236 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
{
Color
}
from
"../models/utils"
;
export
function
parseRGBColor
(
color: string
):
Color
{
if
(!color) {
return
{
r
:
0
,
g
:
0
,
b
:
0
}; }
const
[r, g, b] = color.
split
(
','
).
map
(
Number
);
return
{ r, g, b }; }