( src: [number, number, number, number?], options: ThemeColorOptions = colorOptionsDefault )
| 37 | } |
| 38 | |
| 39 | const fromArrayToRGB = ( |
| 40 | src: [number, number, number, number?], |
| 41 | options: ThemeColorOptions = colorOptionsDefault |
| 42 | ): string => { |
| 43 | const [red, green, blue, alpha = 1] = src |
| 44 | const { alpha: alphaOverwrite = 1 } = options |
| 45 | |
| 46 | const r = minMax0to100(red) |
| 47 | const g = minMax0to100(green) |
| 48 | const b = minMax0to100(blue) |
| 49 | const a = minMax0to1(alpha) * minMax0to1(alphaOverwrite) |
| 50 | return `rgb(${r}%,${g}%,${b}%,${a})` |
| 51 | } |
| 52 | |
| 53 | const fromArrayToLCH = ( |
| 54 | src: [number, number, number, number?], |
no outgoing calls
no test coverage detected