(hex: string)
| 48 | [color.red, color.green, color.blue].map(channelToByte).join(" "); |
| 49 | |
| 50 | export const hexToColor = (hex: string): Color => { |
| 51 | const [red, green, blue] = hexToRgb(hex); |
| 52 | return create(ColorSchema, { |
| 53 | red: red / 255, |
| 54 | green: green / 255, |
| 55 | blue: blue / 255, |
| 56 | }); |
| 57 | }; |
| 58 | |
| 59 | /** |
| 60 | * |