1.0.7 • Published 4 years ago

color-fade v1.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago
features
  • fade between two colors
  • scatter fade steps as your wanted.
  • get color of the specific point
How is it works
const fadeColor = require('color-fade')
const startingColor = "#66cdaa"
const endingColor = "#ffffff"
const numberOfSteps = 5

const color = await fadeColor(startingColor, endingColor, numberOfSteps)
// [ '#66cdaa', '#8cdabf', '#b3e6d5', '#d9f3ea', '#ffffff' ]

you can get specific point color code

const fadeColor = require('color-fade')
const startingColor = "#66cdaa"
const endingColor = "#ffffff"
const numberOfSteps = 5
const selectColorAt = 3

const color = await fadeColor(startingColor, endingColor, numberOfSteps, selectColorAt)
//'#b3e6d5'

specify output type

  • default it will return as hex
const fadeColor = require('color-fade')
const startingColor = "#66cdaa"
const endingColor = "#ffffff"
const numberOfSteps = 5
const selectColorAt = 3
const format = 'hex' // 'rgb' 

const color = await fadeColor(startingColor, endingColor, numberOfSteps, selectColorAt, format)
//'#b3e6d5'
1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago