color-lighten-tool
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

color-lighten-tool

Output = Input color * opacity + white background

Language : English | 中文

📦 UMD module & ESModule, offer .d.ts file to support Typescript.

Install

npm i color-lighten-tool

API

function colorLightenTool(color: string, opacity: number): string

import colorLightenTool from 'color-lighten-tool'

const outPutColor = colorLightenTool('rgb(255,0,0)', 0.4) // rgb(255,153,153)
const outPutColor = colorLightenTool('#FF0000', 0.4) // rgb(255,153,153)

For advanced users, you can pass a color to replace white background.

function colorLightenTool(color: string, opacity: number[, bgColor: {r: number, g: number, b: number}]): string

Output = Input color * opacity + custom background color

DEMO

Code Sandbox

Or Check demo.html in Git for more detail .

Package Sidebar

Install

npm i color-lighten-tool

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

17.8 kB

Total Files

14

Last publish

Collaborators

  • old_dream