UNPKG
colorpath
Version:
latest (0.1.4)
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
Find path for colors
github.com/Leopoldthecoder/colorpath
Leopoldthecoder/colorpath
colorpath
/
src
/
shade.js
9 lines
(6 loc)
•
195 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
import
util
from
'./utils/index'
const
shade
= (
s, p
) => {
const
source = util.
formatColor
(s)
return
source.
map
(
sourceChannel
=>
Math
.
round
(sourceChannel * (
1
- p))) }
export
default
shade