Skip to content

Commit

Permalink
fix some types
Browse files Browse the repository at this point in the history
  • Loading branch information
mimarz committed Aug 22, 2024
1 parent 3bb1688 commit f608b29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/cli/src/colors/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type { CssColor } from '@adobe/leonardo-contrast-colors';
import { BackgroundColor, Color, Theme } from '@adobe/leonardo-contrast-colors';
import { Hsluv } from 'hsluv';

import type { BaseColors, ColorInfo, ColorMode, ColorNumber, ContrastMode, ThemeColors, ThemeInfo } from './types';
import type { ColorInfo, ColorMode, ColorNumber, ContrastMode, GlobalColors, ThemeColors, ThemeInfo } from './types';
import { getContrastFromHex, getContrastFromLightness, getLightnessFromHex } from './utils';

export const baseColors: Record<BaseColors, CssColor> = {
export const baseColors: Record<GlobalColors, CssColor> = {
blue: '#0A71C0',
green: '#078D19',
orange: '#CA5C21',
Expand Down Expand Up @@ -164,7 +164,7 @@ export const generateThemeForColor = (color: CssColor, contrastMode: 'aa' | 'aaa
};
};

export const generateGlobalColors = ({ contrastMode = 'aa' }: GlobalGenType) => {
export const generateGlobalColors = ({ contrastMode = 'aa' }: GlobalGenType): Record<GlobalColors, ThemeInfo> => {
const blueTheme = generateThemeForColor(baseColors.blue, contrastMode);
const greenTheme = generateThemeForColor(baseColors.green, contrastMode);
const orangeTheme = generateThemeForColor(baseColors.orange, contrastMode);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/colors/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { CssColor } from '@adobe/leonardo-contrast-colors';
export type ColorMode = 'light' | 'dark' | 'contrast';
export type ContrastMode = 'aa' | 'aaa';
export type ColorNumber = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
export type BaseColors = 'red' | 'blue' | 'green' | 'orange' | 'purple' | 'yellow';
export type GlobalColors = 'red' | 'blue' | 'green' | 'orange' | 'purple' | 'yellow';
export type ThemeColors = 'accent' | 'neutral' | 'brand1' | 'brand2' | 'brand3';
export type ColorInfo = {
hex: CssColor;
Expand Down

0 comments on commit f608b29

Please sign in to comment.