Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Super simple color manipulation using getters and setters
Install:
npm install --save jscolor
Usage:
import Color from 'jscolor'
let c = new Color('#483d8b')
Read color values without any extra work:
c.r // => 72
c.g // => 61
c.b // => 139
c.a // => 1
c.red // => 72
c.green // => 61
c.blue // => 139
c.alpha // => 1
c.rgb // => 'rgb(72,61,139)'
c.rgba // => 'rgba(72,61,139,1)'
c.h // => 248
c.s // => 39
c.l // => 39
c.hue // => 248
c.saturation // => 39
c.lightness // => 39
c.hsl // => hsl(248,39%,39%)
c.hsla // => hsla(248,39%,39%,1)
c.hex // => '#483d8b'
c.yiq // => 73.181
c.name // => 'darkslateblue'
Manipulate colors using normal operators:
c.r = 100
c.rgb // => 'rgb(100,61,139)'
c.hex // => '#643d8b'
c.hue += 180
c.rgb // => 'rgb(129,139,61)'
c.hex // => '#648b3d'
c.rgb = 'rgb(150,170,180)'
c.hsl // => 'hsl(200,17%,65%)'
c.hex // => '#96aab4'
FAQs
Super simple color manipulation using getters and setters
The npm package jscolor receives a total of 413 weekly downloads. As such, jscolor popularity was classified as not popular.
We found that jscolor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.