chore(editor): update default colors of shape (#9633)

Closes: [PD-2176](https://linear.app/affine-design/issue/PD-2176/edgeless-shape默认颜色调整)

* updates shape's text color to the `#000000ff` and custom button should be selected by default in color picker
* updates shape background default color palette to `medium`

<img width="727" alt="Screenshot 2025-01-13 at 11 07 14" src="https://github.com/user-attachments/assets/81962741-0dbc-4990-8eec-db5e48624305" />
<img width="444" alt="Screenshot 2025-01-13 at 11 07 09" src="https://github.com/user-attachments/assets/2d119e33-635e-4bd4-826f-e3094c8a3fa2" />

<img width="764" alt="Screenshot 2025-01-13 at 11 08 14" src="https://github.com/user-attachments/assets/09f5c778-0e25-4972-8529-8d8323c27594" />
This commit is contained in:
fundon
2025-01-13 10:19:58 +00:00
parent 810e656174
commit 7e5e6031e8
7 changed files with 23 additions and 35 deletions

View File

@@ -1,5 +1,5 @@
import type { Palette, Theme } from './types.js';
import { buildPalettes, getColorByKey, pureBlack, pureWhite } from './utils.js';
import type { Palette, Theme } from './types';
import { buildPalettes, getColorByKey, pureBlack, pureWhite } from './utils';
const Transparent = 'transparent';
const White = getColorByKey('edgeless/palette/white');
@@ -78,7 +78,7 @@ const StrokeColorPalettes: Palette[] = [
...buildPalettes(StrokeColorMap),
] as const;
const FillColorMap = { ...Light, Black, White } as const;
const FillColorMap = { ...Medium, Black, White } as const;
const FillColorPalettes: Palette[] = [...buildPalettes(FillColorMap)] as const;
@@ -89,9 +89,11 @@ export const DefaultTheme: Theme = {
white: White,
transparent: Transparent,
textColor: Medium.Blue,
shapeTextColor: Black,
// Custom button should be selected by default,
// add transparent `ff` to distinguish `#000000`.
shapeTextColor: '#000000ff',
shapeStrokeColor: Medium.Yellow,
shapeFillColor: Light.Yellow,
shapeFillColor: Medium.Yellow,
connectorColor: Medium.Grey,
noteBackgrounColor: NoteBackgroundColorMap.White,
Palettes,

View File

@@ -1,9 +1,9 @@
import { DefaultTheme } from './default.js';
import type { Theme } from './types.js';
import { DefaultTheme } from './default';
import type { Theme } from './types';
export * from './color.js';
export { DefaultTheme } from './default.js';
export * from './types.js';
export * from './color';
export { DefaultTheme } from './default';
export * from './types';
export const Themes: Record<string, Theme> = {
default: DefaultTheme,

View File

@@ -1,6 +1,6 @@
import { z } from 'zod';
import { ColorSchema } from './color.js';
import { ColorSchema } from './color';
export const PaletteSchema = z.object({
key: z.string(),

View File

@@ -4,8 +4,8 @@ import {
lightThemeV2,
} from '@toeverything/theme/v2';
import type { Color } from './color.js';
import type { Palette } from './types.js';
import type { Color } from './color';
import type { Palette } from './types';
// Converts a color map to color list.
export function buildPalettes(