Socket
Book a DemoInstallSign in
Socket

color-lighten-tool

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-lighten-tool

Make color lighten, like add opacity and white background.

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
7
133.33%
Maintainers
1
Weekly downloads
 
Created
Source

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 .

Keywords

lighten

FAQs

Package last updated on 21 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.