You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
362 B
TypeScript
14 lines
362 B
TypeScript
export type Color = string & { readonly __color: unique symbol };
|
|
export const color = (hex: string) => hex as Color;
|
|
|
|
export interface Face {
|
|
fg: Color | null,
|
|
bg: Color | null,
|
|
}
|
|
export const createFace = (
|
|
fg: Face["fg"],
|
|
bg: Face["bg"],
|
|
): Face => ({ fg, bg });
|
|
export const fgBg = createFace;
|
|
export const fg = (fg: Face["fg"]) => createFace(fg, null);
|