1.3.0 • Published 11 months ago

material-color-scheme v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

material-color-scheme

Generate a color scheme based on material design v3

Demo

https://shockerqt.github.io/material-color-scheme/

Usage

Install

npm i material-color-scheme

Generate a scheme from a color (named or hex)

const { dark, light, cssDark, cssLight } = schemesFromColor('red');

Set the scheme on the DOM

setCSSRules(cssDark);

Want a prefix for your css variables?

// generates variables with `--a-prefix-color` format
const scheme = schemesFromColor('#0000ff', 'a-prefix');

Add colors to the scheme

const customColors: CustomColor[] = [
  {
    name: 'red alert',
    value: 'red',
    blend: true,
  },
];
const scheme = schemesFromColor('#0000ff', null, customColors);

Add fixed colors to the scheme

const rawColors: RawColors = {
  red: '#ff0000',
  blue: '#0000ff',
};
const scheme = schemesFromColor('#0000ff', null, null, rawColors);
1.3.0

11 months ago

1.2.0

11 months ago

1.1.0

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago