Document ref/color further

This commit is contained in:
Nate Butler
2023-02-11 08:14:13 -05:00
parent dda0febf39
commit 0acb820f04
3 changed files with 10 additions and 0 deletions
+4
View File
@@ -17,11 +17,15 @@ function assignColor(scale: Scale, steps: number, step: number) {
const rgbaArray = color.rgba();
const hex = color.hex();
// Roughly calculate if a color is dark or light
const isLight = lch[0] > 50;
const result = {
step,
hex,
lch,
rgbaArray,
isLight,
};
return result;
+5
View File
@@ -2,6 +2,11 @@ import chroma from "chroma-js";
import { generateColorSet } from "../algorithm";
import { ColorFamily } from "../types";
// These are the source colors for the color scales in the system.
// This should never directly be used in the system, or exported to be used in a component or theme
// As it will generate thousands of lines of code.
// Instead, use the outputs from the reference palette which exports a smaller subset of colors.
// Colors should use the LCH color space.
// https://www.w3.org/TR/css-color-4/#lch-colors
+1
View File
@@ -6,6 +6,7 @@ export type Color = {
};
export type ColorSet = Color[];
export type ColorFamily = {
name: string;
colors: string[];