Skip to content
Random color scheme generator
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
lib
spec
src
.babelrc
.gitignore
bower.json
index.html
package-lock.json
package.json
preview.js
readme.md

readme.md

Pafiume Colors

Random color scheme generator

Install

Using npm:

$ npm install pafiume-colors

Using yarn:

$ yarn add pafiume-colors

Using bower:

$ bower install pafiume-colors

Load

From npm:

const pafiumeColors = require('pafiume-colors');

From Bower:

<script src="/bower_components/pafiume-colors/colors.js"></script>

The pafiumeColors Object loads into global scope from the above script.

Usage

pafiumeColors

The pafiumeColors Object contains multiple API to grab random colors:

random()

color.random()              // => {...};

get(name)

Produces a specific color.

color.get('infinity');      // => {...};

scheme(quantity)

Produces an array of unique colors. Can produce quantity anywhere from 0 - total available colors.

  • Unspecified quantity results in array of 1 color
  • Negative number quantity results in array of 1 color
  • Quantity greater than available colors results in array of all colors
color.scheme(3);            // => [ {...}, {...}, {...} ];
color.scheme();             // => [ {...} ];
color.scheme(-3);           // => [ {...} ];
color.scheme(100);          // => [ {...} ... ];

getAll()

Produces an array of all colors.

color.getAll();             // => [ {...} ... ];

Color Object

Each color Object produced by pafiumeColors has two properties

  1. name - String representing name of color set
  2. hues - Array containing hex color Strings, ordered light to dark
{
  name: 'infinity',
  hues: [
    '#ACABB3',
    '#8E8C97',
    '#5F6062',
    '#24232A',
  ],
}

Colors

alt text alt text alt text alt text

You can’t perform that action at this time.