UNPKG
chromatism2
Version:
latest (3.0.2)
3.0.2
3.0.1
A simple set of utility functions for colours.
github.com/tehshrike/chromatism
tehshrike/chromatism
chromatism2
/
src
/
helpers
/
bounded-rgb.js
12 lines
(9 loc)
•
222 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import
bounded
from
'./bounded'
const
bounded255
= val =>
bounded
(val, [
0
,
255
])
export
default
function
boundedRgb
(
rgb
) {
return
{
r
:
bounded255
(rgb.
r
),
g
:
bounded255
(rgb.
g
),
b
:
bounded255
(rgb.
b
) } }