mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-21 08:17:10 +08:00
fix(editor): adjust black and white in shape text color palettes to pure black and pure white (#10450)
Closes: [BS-2697](https://linear.app/affine-design/issue/BS-2697/检查shape-text-color黑白不映射的pr合并状态) https://github.com/user-attachments/assets/732612e9-5e43-453f-aef2-5f32f5a08614
This commit is contained in:
@@ -72,15 +72,44 @@ const NoteBackgroundColorPalettes: Palette[] = [
|
||||
...buildPalettes(NoteBackgroundColorMap),
|
||||
] as const;
|
||||
|
||||
const StrokeColorMap = { ...Medium, Black, White } as const;
|
||||
const StrokeColorShortMap = { ...Medium, Black, White } as const;
|
||||
|
||||
const StrokeColorPalettes: Palette[] = [
|
||||
...buildPalettes(StrokeColorMap),
|
||||
const StrokeColorShortPalettes: Palette[] = [
|
||||
...buildPalettes(StrokeColorShortMap),
|
||||
] as const;
|
||||
|
||||
const FillColorMap = { ...Medium, Black, White } as const;
|
||||
const FillColorShortMap = { ...Medium, Black, White } as const;
|
||||
|
||||
const FillColorPalettes: Palette[] = [...buildPalettes(FillColorMap)] as const;
|
||||
const FillColorShortPalettes: Palette[] = [
|
||||
...buildPalettes(FillColorShortMap),
|
||||
] as const;
|
||||
|
||||
const ShapeTextColorShortMap = {
|
||||
...Medium,
|
||||
Black: pureBlack,
|
||||
White: pureWhite,
|
||||
} as const;
|
||||
|
||||
const ShapeTextColorShortPalettes: Palette[] = [
|
||||
...buildPalettes({ ...ShapeTextColorShortMap }),
|
||||
] as const;
|
||||
|
||||
const ShapeTextColorPalettes: Palette[] = [
|
||||
// Light
|
||||
...buildPalettes(Light, 'Light'),
|
||||
|
||||
{ key: 'Transparent', value: Transparent },
|
||||
|
||||
// Medium
|
||||
...buildPalettes(Medium, 'Medium'),
|
||||
|
||||
{ key: 'White', value: pureWhite },
|
||||
|
||||
// Heavy
|
||||
...buildPalettes(Heavy, 'Heavy'),
|
||||
|
||||
{ key: 'Black', value: pureBlack },
|
||||
] as const;
|
||||
|
||||
export const DefaultTheme: Theme = {
|
||||
pureBlack,
|
||||
@@ -89,18 +118,19 @@ export const DefaultTheme: Theme = {
|
||||
white: White,
|
||||
transparent: Transparent,
|
||||
textColor: Medium.Blue,
|
||||
// Custom button should be selected by default,
|
||||
// add transparent `ff` to distinguish `#000000`.
|
||||
shapeTextColor: '#000000ff',
|
||||
shapeTextColor: pureBlack,
|
||||
shapeStrokeColor: Medium.Yellow,
|
||||
shapeFillColor: Medium.Yellow,
|
||||
connectorColor: Medium.Grey,
|
||||
noteBackgrounColor: NoteBackgroundColorMap.White,
|
||||
Palettes,
|
||||
StrokeColorMap,
|
||||
StrokeColorPalettes,
|
||||
FillColorMap,
|
||||
FillColorPalettes,
|
||||
ShapeTextColorPalettes,
|
||||
NoteBackgroundColorMap,
|
||||
NoteBackgroundColorPalettes,
|
||||
StrokeColorShortMap,
|
||||
StrokeColorShortPalettes,
|
||||
FillColorShortMap,
|
||||
FillColorShortPalettes,
|
||||
ShapeTextColorShortMap,
|
||||
ShapeTextColorShortPalettes,
|
||||
} as const;
|
||||
|
||||
@@ -21,16 +21,20 @@ export const ThemeSchema = z.object({
|
||||
shapeFillColor: ColorSchema,
|
||||
connectorColor: ColorSchema,
|
||||
noteBackgrounColor: ColorSchema,
|
||||
// Universal color palette
|
||||
|
||||
// Universal color palettes
|
||||
Palettes: z.array(PaletteSchema),
|
||||
StrokeColorMap: z.record(z.string(), ColorSchema),
|
||||
// Usually used in global toolbar and editor preview
|
||||
StrokeColorPalettes: z.array(PaletteSchema),
|
||||
FillColorMap: z.record(z.string(), ColorSchema),
|
||||
// Usually used in global toolbar and editor preview
|
||||
FillColorPalettes: z.array(PaletteSchema),
|
||||
ShapeTextColorPalettes: z.array(PaletteSchema),
|
||||
NoteBackgroundColorMap: z.record(z.string(), ColorSchema),
|
||||
NoteBackgroundColorPalettes: z.array(PaletteSchema),
|
||||
|
||||
// Usually used in global toolbar and editor preview
|
||||
StrokeColorShortMap: z.record(z.string(), ColorSchema),
|
||||
StrokeColorShortPalettes: z.array(PaletteSchema),
|
||||
FillColorShortMap: z.record(z.string(), ColorSchema),
|
||||
FillColorShortPalettes: z.array(PaletteSchema),
|
||||
ShapeTextColorShortMap: z.record(z.string(), ColorSchema),
|
||||
ShapeTextColorShortPalettes: z.array(PaletteSchema),
|
||||
});
|
||||
|
||||
export type Theme = z.infer<typeof ThemeSchema>;
|
||||
|
||||
Reference in New Issue
Block a user