New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

niceramps

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

niceramps

a color ramp generator for design systems

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

niceramps

a color ramp generator for design systems

how it works

the two main ways of mixing colors are to treat colors like paint or like ink.

to get a ramp of lightess values, you can either mix with white or black paint like so:

paint

or vary the concentration of ink like so:

ink

the results of either don't look too pleasing, but a combination of the two methods looks perfect:

mix

functions

const {colorAtLightness, ramp, tailwindRamp} = require("niceramps");
colorAtLightness(hex, lightness, options)
ramp(hex, options)
tailwindRamp(hex, options)

tailwindRamp() generates colors for tailwindcss' naming convention https://tailwindcss.com/docs/customizing-colors

options

all options are optional, by default 10 colors are generated with 40% ink and 60% paint

{
	increment: 10,
//     distance between shades
//     0 is black and 100 is white

	saturation: 0.4,
//     0 is pure paint
//     1 is pure ink
}

cli

this package includes a command line utility in cli.js

usage

npx niceramps '#d972d6' --increment=10 --saturation=1

add the -t flag to generate tailwindcss colors

FAQs

Package last updated on 02 May 2021

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