Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/KyleAMathews/color-pairs-picker
Given a color, it picks pleasing and well contrasted background and foreground colors
https://github.com/KyleAMathews/color-pairs-picker
Last synced: 4 months ago
JSON representation
Given a color, it picks pleasing and well contrasted background and foreground colors
- Host: GitHub
- URL: https://github.com/KyleAMathews/color-pairs-picker
- Owner: KyleAMathews
- License: mit
- Created: 2014-12-12T23:26:44.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-03T20:29:57.000Z (almost 8 years ago)
- Last Synced: 2024-08-06T15:48:45.729Z (4 months ago)
- Language: CoffeeScript
- Homepage: http://kyleamathews.github.io/color-pairs-picker/
- Size: 444 KB
- Stars: 14
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build
Status](https://img.shields.io/travis/KyleAMathews/color-pairs-picker/master.svg?style=flat-square)](http://travis-ci.org/KyleAMathews/color-pairs-picker)color-pairs-picker
==================Given a color, it picks a pleasing and [well contrasted](http://contrastrebellion.com/) 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```javascript
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});
```