diff --git a/packages/core/engine/generator.ts b/packages/core/engine/generator.ts index 4cf509a..d23a831 100644 --- a/packages/core/engine/generator.ts +++ b/packages/core/engine/generator.ts @@ -58,7 +58,7 @@ function replaceAtIndex(array: (number | string)[], index: number, value: string return newArray } -function putAccentInRange(adjusted: UmbraAdjusted, accent: Partial | string, input: UmbraScheme) { +function putAccentInRange(adjusted: UmbraAdjusted, accent: Accent | string, input: UmbraScheme) { const isString = typeof accent === 'string' const color = isString ? accent : accent.color const insertion = input.settings?.insertion @@ -74,7 +74,7 @@ function putAccentInRange(adjusted: UmbraAdjusted, accent: Partial | str function accents(input: UmbraScheme, adjusted: UmbraAdjusted) { const { background, foreground } = adjusted - function gen(accent: string | Partial) { + function gen(accent: string | Accent) { const isString = typeof accent === 'string' const name = isString ? undefined : accent.name diff --git a/packages/core/engine/types/index.ts b/packages/core/engine/types/index.ts index 6080b07..c01211b 100644 --- a/packages/core/engine/types/index.ts +++ b/packages/core/engine/types/index.ts @@ -23,10 +23,11 @@ export interface UmbraOutput { } export interface Accent { - name: string + name?: string color: string - shades: (number | string)[] - readability: number + shades?: (number | string)[] + tints?: (number | string)[] + readability?: number } export type UmbraInput = Partial @@ -39,13 +40,13 @@ export interface UmbraScheme extends UmbraColors { export interface UmbraColors { background: string foreground: string - accents: string | (string | Partial)[] + accents: string | (string | Accent)[] } export interface UmbraAdjusted { background: Colord foreground: Colord - accents: (string | Partial)[] + accents: (string | Accent)[] } export interface UmbraSettings { diff --git a/packages/core/index.ts b/packages/core/index.ts index dfa06a1..f54a0de 100644 --- a/packages/core/index.ts +++ b/packages/core/index.ts @@ -8,6 +8,7 @@ import type { FlattenColor, Formater, UmbraOutputs } from './engine/primitives/f import { attach } from './engine/primitives/attach' import { mostReadable, getReadability, colorMix } from './engine/primitives/color' import type { + Accent, UmbraScheme, UmbraInput, UmbraOutput, @@ -35,6 +36,7 @@ export { } export type { + Accent, Umbra, UmbraScheme, UmbraSettings, diff --git a/packages/nobel/src/App.vue b/packages/nobel/src/App.vue index 261c5d0..817f298 100644 --- a/packages/nobel/src/App.vue +++ b/packages/nobel/src/App.vue @@ -13,17 +13,18 @@ import ButtonGroup from './components/ui/Button/ButtonGroup.vue' import TextScreen from './components/TextScreen.vue' import { umbra } from '@umbrajs/core' +import type { Accent } from '@umbrajs/core' const route = useRoute() const inversed = ref(true) -const warningAccent = { +const warningAccent: Accent = { name: 'warning', color: '#ff0000' } -const successAccent = { +const successAccent: Accent = { name: 'success', color: '#00ff00' }