Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Organize

Nate Butlerdda0febf3903
diff --git a/styles/src/system/algorithm.ts b/styles/src/system/algorithm.ts
index 74a01a5ab89..7d5161ca22d 100644
--- a/styles/src/system/algorithm.ts
+++ b/styles/src/system/algorithm.ts
@@ -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)) {
diff --git a/styles/src/system/lib/curves.ts b/styles/src/system/curves.ts
similarity index 100%
rename from styles/src/system/lib/curves.ts
rename to styles/src/system/curves.ts
diff --git a/styles/src/system/ref/color.ts b/styles/src/system/ref/color.ts
index bb3a14540fc..f49125f4f7d 100644
--- a/styles/src/system/ref/color.ts
+++ b/styles/src/system/ref/color.ts
@@ -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
diff --git a/styles/src/system/types.ts b/styles/src/system/types.ts
new file mode 100644
index 00000000000..61c5a505444
--- /dev/null
+++ b/styles/src/system/types.ts
@@ -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;
+ };
+}