Skip to content

Instantly share code, notes, and snippets.

@rafaelrinaldi
Created January 25, 2018 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelrinaldi/1250b7dd5d704d84b50a7e103c3b0358 to your computer and use it in GitHub Desktop.
Save rafaelrinaldi/1250b7dd5d704d84b50a7e103c3b0358 to your computer and use it in GitHub Desktop.
import { get as scale } from '../../utils';
import { Colors } from './colors';
import chroma from 'chroma-js';
const darken = alpha =>
chroma(Colors.BLACK)
.alpha(alpha)
.css();
export const gray = scale({
0: darken(0),
1: darken(0.25),
2: darken(0.5),
3: darken(0.75),
4: darken(1),
});
// Receives a hash map and returns a function that resolves a value given an id
export const get = map => id => map[id];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment