Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

color-to-color

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-to-color

Transform a color to color based on a percent

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-62.5%
Maintainers
1
Weekly downloads
 
Created
Source

color-to-color

Transform color to color based with percentage

Install

With npm

npm i color-to-color -S

Usage

const fromColor = 'red';
const toColor = 'blue';
tctc(fromColor).toColor(toColor).withPercent(50).get(); // { r: 127, g: 0, b: 127 }

tctc(fromColor).toColor(toColor).withPercent(28).get('rgb'); // rgb(183, 0, 71)
tctc(fromColor).toColor(toColor).withPercent(50).get('hex'); // #7F007F
tctc(fromColor).toColor(toColor).withPercent(100).get('hsl'); // hsl(0, 0%, 255%)
tctc(fromColor).toColor(toColor).withPercent(84).get('hwb'); // hwb(40, 0%, 214%)

tctc(fromColor).toColor(toColor).withPercent(0).get('keyword'); // red
tctc(fromColor).toColor(toColor).withPercent(100).get('keyword'); // blue
tctc(fromColor).toColor(toColor).withPercent(65).get('keyword'); // undefined

License

MIT

Keywords

FAQs

Package last updated on 22 Dec 2018

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