mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 21:32:40 +00:00
Organize
This commit is contained in:
parent
0e238210bb
commit
dda0febf39
4 changed files with 28 additions and 27 deletions
|
@ -1,31 +1,7 @@
|
|||
// Adapted from @k-vyn/coloralgorithm
|
||||
|
||||
import chroma, { Scale } from "chroma-js";
|
||||
|
||||
export type Color = {
|
||||
step: number;
|
||||
hex: string;
|
||||
lch: number[];
|
||||
rgbaArray: number[];
|
||||
};
|
||||
|
||||
export type ColorSet = Color[];
|
||||
export type ColorFamily = {
|
||||
name: string;
|
||||
colors: string[];
|
||||
invertedColors: string[];
|
||||
colorsMeta: ColorSet;
|
||||
invertedMeta: ColorSet;
|
||||
};
|
||||
|
||||
export interface ColorProps {
|
||||
name: string;
|
||||
color: {
|
||||
start: string;
|
||||
middle: string;
|
||||
end: string;
|
||||
};
|
||||
}
|
||||
import { ColorFamily, ColorProps, ColorSet } from "./types";
|
||||
|
||||
function validColor(color: string) {
|
||||
if (chroma.valid(color)) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import * as chroma from "chroma-js";
|
||||
import { ColorFamily, generateColorSet } from "../algorithm";
|
||||
import chroma from "chroma-js";
|
||||
import { generateColorSet } from "../algorithm";
|
||||
import { ColorFamily } from "../types";
|
||||
|
||||
// Colors should use the LCH color space.
|
||||
// https://www.w3.org/TR/css-color-4/#lch-colors
|
||||
|
|
24
styles/src/system/types.ts
Normal file
24
styles/src/system/types.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
export type Color = {
|
||||
step: number;
|
||||
hex: string;
|
||||
lch: number[];
|
||||
rgbaArray: number[];
|
||||
};
|
||||
|
||||
export type ColorSet = Color[];
|
||||
export type ColorFamily = {
|
||||
name: string;
|
||||
colors: string[];
|
||||
invertedColors: string[];
|
||||
colorsMeta: ColorSet;
|
||||
invertedMeta: ColorSet;
|
||||
};
|
||||
|
||||
export interface ColorProps {
|
||||
name: string;
|
||||
color: {
|
||||
start: string;
|
||||
middle: string;
|
||||
end: string;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue