colorpath
Version:
Find path for colors
13 lines (10 loc) • 308 B
JavaScript
import util from './utils/index'
const tint = (s, p) => {
const source = util.formatColor(s)
return source.map(sourceChannel => {
sourceChannel = Number(sourceChannel)
const whiteChannel = 255
return Math.round(sourceChannel + (whiteChannel - sourceChannel) * p)
})
}
export default tint