All Projects → sterlingwes → Randomcolor

sterlingwes / Randomcolor

Licence: mit
Javascript module for generating random, distinguishable, pleasing colors (ie: for chart series).

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Randomcolor

random color
⚙️🎨 Rust crate for generating random attractive colors
Stars: ✭ 30 (-63.86%)
Mutual labels:  random, colors
golden-colors
Generate random colors using Golden ratio conjugate
Stars: ✭ 16 (-80.72%)
Mutual labels:  random, colors
Pgen
Command-line passphrase generator
Stars: ✭ 68 (-18.07%)
Mutual labels:  random
Eth Random
commit-reveal RNG method in Ethereum
Stars: ✭ 79 (-4.82%)
Mutual labels:  random
Colority
🎨 (~1kb) library to extract colors from pictures.
Stars: ✭ 74 (-10.84%)
Mutual labels:  colors
Dazv
canvas 可视化图表
Stars: ✭ 70 (-15.66%)
Mutual labels:  chart
Color Names
Large list of handpicked color names 🌈
Stars: ✭ 1,198 (+1343.37%)
Mutual labels:  colors
Flowa
🔥Service level control flow for Node.js
Stars: ✭ 66 (-20.48%)
Mutual labels:  series
Birdseed
🐦 🎲 Use Twitter's Search API to get random numbers
Stars: ✭ 81 (-2.41%)
Mutual labels:  random
Blenderdatavis
Data visualisation addon for Blender
Stars: ✭ 72 (-13.25%)
Mutual labels:  chart
Ditherjs
A javascript library which dithers an <img> using a fixed palette
Stars: ✭ 76 (-8.43%)
Mutual labels:  colors
Sing App
💥Free and open-source admin dashboard template built with Bootstrap 4.5 💥
Stars: ✭ 1,187 (+1330.12%)
Mutual labels:  chart
Random Bytes Readable Stream
Creates a readable stream producing cryptographically strong pseudo-random data using `crypto.randomBytes()`
Stars: ✭ 71 (-14.46%)
Mutual labels:  random
Ac D3
Javascript Library for building Audiovisual Charts in D3
Stars: ✭ 76 (-8.43%)
Mutual labels:  chart
Random
Generate random strings or numeric values
Stars: ✭ 68 (-18.07%)
Mutual labels:  random
Highcharts trendline
HighCharts demo of scatter plot, including a trend line
Stars: ✭ 79 (-4.82%)
Mutual labels:  chart
Bitcoin Price Prediction Using Lstm
Bitcoin price Prediction ( Time Series ) using LSTM Recurrent neural network
Stars: ✭ 67 (-19.28%)
Mutual labels:  series
Colors
List of 256 color codes for Xterm including an example of the color, Xterm Name, Xterm Number, HEX, RGB and HSL code.
Stars: ✭ 73 (-12.05%)
Mutual labels:  colors
Random Word
This is a simple python package to generate random english words
Stars: ✭ 75 (-9.64%)
Mutual labels:  random
Ember C3
📈 Ember addon library for C3, a D3-based reusable chart library.
Stars: ✭ 81 (-2.41%)
Mutual labels:  chart

Random Color

Coverage Status

Random color is a simple javascript module for generating random colors that contrast enough to distinguish between one another, and are not too loud (by default, all colours can have readable black/dark font overlayed).

Example

Useful, for example, in charts and diagrams where X number of series need to be distinguished by color.

See changelog.

Getting it

Node.js

npm install rcolor

Browser

Clone this repo / copy dist/rcolor.min.js

Note that the dist/rcolor.js file is a CommonJS export (the node.js build)

Using it

With the browser build:

window.rcolor()
// > "#79f2ab"

With the node build:

const rcolor = require('rcolor')
rcolor() // "#79f2ab"

This module holds the initial random number seed as internal state. To regenerate the random number seed, call the reSeed method: rcolor.reSeed().

Options / Configuration

You can specify the hue, saturation and value. The following are the defaults:

const goldenRatio = 0.618 // ... truncated

rcolor({
  hue: (Math.random() + goldenRatio) % 1,
  saturation: 0.5,
  value: 0.95
})

Pre-v1.0

If you used this module prior to NPM availability (between 2013 and 2017), you can find that source (including the Dart version) on the legacy branch.

License

Free to use and distribute under the MIT license.

Sorry, Colour

Apologies in advance to my commonwealth friends, if you find 'color' vs. 'colour'. It was a hard decision for a Canadian. :)

Wes Johnson @SterlingWes

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].