Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.55 KB

README.md

File metadata and controls

44 lines (30 loc) · 1.55 KB

color-this

npm Travis branch Coveralls github branch GitHub stars GitHub issues semantic-release

Generate a random color from a given string

Add color to graph series names, months of the year, days of the week, super useful to add a unique subtle differentiator.

Demos

Getting Started

Load from npm

# NPM
npm i @eknowles/color-this

# Yarn
yarn add @eknowles/color-this

Now import and use in React, Node or wherever!

import React from 'react';
import ct from '@eknowles/color-this';

export const MyLabelComponent = ({text}) => (
  <div style={{background: ct(text)}}>{text}</div>
);

Frameworks

AngularJS - http://eknowles.github.io/angular-color-this/