UNPKG

colorpath

Version:
13 lines (10 loc) 308 B
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