[go: up one dir, main page]

color-pairs-picker

1.3.6 • Public • Published

BuildStatus

color-pairs-picker

Given a color, it picks a pleasing and well contrasted background and foreground colors

Demo

http://kyleamathews.github.io/color-pairs-picker/

Install

npm install color-pairs-picker

Usage

This module attempts to pick pleasing color pairs that satisfy the following constraints:

  • Contrast > 4.5 for easy readability
  • Avoid pure blacks and pure whites.
  • Keep the background color > 0.15 luminance
var colorPairsPicker = require 'color-pairs-picker';
 
var baseColor = "#BA55D3";
 
var pair = colorPairsPicker(baseColor);
 
// Set a higher contrast over the default 5.5.
// Note, the more saturated your colors the less contrasty they'll be.
var pair = colorPairsPicker(baseColor, {contrast: 8});

Readme

Keywords

Package Sidebar

Install

npm i color-pairs-picker

Weekly Downloads

6

Version

1.3.6

License

MIT

Last publish

Collaborators

  • kylemathews