diff --git a/packages/core/engine/hydration.ts b/packages/core/engine/hydration.ts deleted file mode 100644 index 28ff870..0000000 --- a/packages/core/engine/hydration.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { colord } from 'colord' -import type { UmbraInput, Accent } from './types' - -interface HydrateProps { - input: UmbraInput - adjusted: { - background: string - foreground: string - accents: (Accent | string)[] - } - generated: { - name: string - background: string - foreground: string - shades: string[] - }[] -} - -export function dehydrateOutput(output: any) { - return JSON.stringify(output) -} - -function rehydrateColord(color: string) { - const parsed = JSON.parse(color) - return colord(`rgb(${parsed.r}, ${parsed.g}, ${parsed.b})`) -} - -export function hydrateOutput({ input, adjusted, generated }: HydrateProps) { - return { - input, - adjusted: { - background: rehydrateColord(adjusted.background), - foreground: rehydrateColord(adjusted.foreground), - accents: adjusted.accents - }, - generated: generated.map((gen) => ({ - name: gen.name, - background: rehydrateColord(gen.background), - foreground: rehydrateColord(gen.foreground), - shades: gen.shades.map(rehydrateColord) - })) - } -} diff --git a/packages/core/engine/types/index.ts b/packages/core/engine/types/index.ts index 54a48c5..7dffc39 100644 --- a/packages/core/engine/types/index.ts +++ b/packages/core/engine/types/index.ts @@ -41,13 +41,6 @@ export interface UmbraAdjusted { accents: (Accent | string)[] } -export interface DehydratedAdjusted { - background: string - foreground: string - accents: (Accent | string)[] - input: UmbraInput -} - export interface UmbraSettings { readability?: number iterations?: number diff --git a/packages/core/index.ts b/packages/core/index.ts index 7ca8e93..0adb178 100644 --- a/packages/core/index.ts +++ b/packages/core/index.ts @@ -20,7 +20,6 @@ import type { FormatedRange } from './engine/types' import { inverse, isDark, findContrast } from './engine/primitives/scheme' -import { dehydrateOutput, hydrateOutput } from './engine/hydration' export { umbra, @@ -36,9 +35,7 @@ export { format, hexFormat, rgbStrippedFormat, - hslFormat, - dehydrateOutput, - hydrateOutput + hslFormat } export type { diff --git a/packages/core/package.json b/packages/core/package.json index 95d6c0f..b6d2de3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@umbrajs/core", - "version": "0.0.44", + "version": "0.0.445", "description": "Umbra is a theme managment library that allows you to create semantic color themes that are easy to dynamically customize, change retroactively and scale progressively", "author": "Samuel M. Bednarz", "repository": {