Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-87.5%
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

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc