@tafalk/material-color-generator
v1.0.12
Published
A zero-runtime-dependency package for generating material colors out of strings
Downloads
1,074
Readme
tafalk/material-color-generator
Idempotently matches given string to a material color.
Light and dark classification is applied regarding the color chart here: If the text color is black for a background, it is considered as a light one; and if white, it is dark.
Install
npm install @tafalk/material-color-generator
And use it in your code like:
import { GetColor } from '@tafalk/material-color-generator'
const color = GetColor('my string', 'dark'); // -> something like 'ffffff'
Possibilities
GetColor
function matches one of the colors below and returns the RGB code.
| Light | Dark |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| ffebee | ef5350 |
| ffcdd2 | f44336 |
| ef9a9a | e53935 |
| e57373 | d32f2f |
| fce4ec | c62828 |
| f8bbd0 | b71c1c |
| f48fb1 | f06292 |
| f3e5f5 | ec407a |
| e1bee7 | e91e63 |
| ce93d8 | d81b60 |
| ede7f6 | c2185b |
| d1c4e9 | ad1457 |
| b39ddb | 880e4f |
| e8eaf6 | ba68c8 |
| c5cae9 | 9c27b0 |
| 9fa8da | 8e24aa |
| e3f2fd | 7b1fa2 |
| bbdefb | 6a1b9a |
| 90caf9 | 4a148c |
| 64b5f6 | 9575cd |
| 42a5f5 | 7e57c2 |
| e1f5fe | 673ab7 |
| b3e5fc | 5e35b1 |
| 81d4fa | 512da8 |
| 4fc3f7 | 4527a0 |
| 29b6f6 | 311b92 |
| 03a9f4 | 7986cb |
| e0f7fa | 5c6bc0 |
| b2ebf2 | 3f51b5 |
| 80deea | 3949ab |
| 4dd0e1 | 303f9f |
| 26c6da | 283593 |
| 00bcd4 | 1a237e |
| 00acc1 | 2196f3 |
| e0f2f1 | 1e88e5 |
| b2dfdb | 1976d2 |
| 80cbc4 | 1565c0 |
| 4db6ac | 0d47a1 |
| e8f5e9 | 039be5 |
| c8e6c9 | 0288d1 |
| a5d6a7 | 0277bd |
| 81c784 | 01579b |
| 66bb6a | 0097a7 |
| 4caf50 | 00838f |
| f1f8e9 | 006064 |
| dcedc8 | 26a69a |
| c5e1a5 | 009688 |
| aed581 | 00897b |
| 9ccc65 | 00796b |
| 8bc34a | 00695c |
| 7cb342 | 004d40 |
| f9fbe7 | 43a047 |
| f0f4c3 | 388e3c |
| e6ee9c | 2e7d32 |
| dce775 | 1b5e20 |
| d4e157 | 689f38 |
| cddc39 | 558b2f |
| c0ca33 | 33691e |
| afb42b | 827717 |
| 9e9d24 | ef6c00 |
| fffde7 | e65100 |
| fff9c4 | ff5722 |
| fff59d | f4511e |
| fff176 | e64a19 |
| ffee58 | d84315 |
| ffeb3b | bf360c |
| fdd835 | a1887f |
| fbc02d | 8d6e63 |
| f9a825 | 795548 |
| f57f17 | 6d4c41 |
| fff8e1 | 5d4037 |
| ffecb3 | 4e342e |
| ffe082 | 3e2723 |
| ffd54f | 757575 |
| ffca28 | 616161 |
| ffc107 | 424242 |
| ffb300 | 212121 |
| ffa000 | 78909c |
| ff8f00 | 607d8b |
| ff6f00 | 546e7a |
| fff3e0 | 455a64 |
| ffe0b2 | 37474f |
| ffcc80 | 263238 |
| ffb74d | |
| ffa726 | |
| ff9800 | |
| fb8c00 | |
| f57c00 | |
| fbe9e7 | |
| ffccbc | |
| ffab91 | |
| ff8a65 | |
| ff7043 | |
| efebe9 | |
| d7ccc8 | |
| bcaaa4 | |
| fafafa | |
| f5f5f5 | |
| eeeeee | |
| e0e0e0 | |
| bdbdbd | |
| 9e9e9e | |
| eceff1 | |
| cfd8dc | |
| b0bec5 | |
| 90a4ae | |