feat: add top picks to appProps for both stoke color and background color

This commit is contained in:
feng 2025-04-12 20:53:09 +09:00
parent dff69e9191
commit f9d4030b82
2 changed files with 7 additions and 2 deletions

View file

@ -326,7 +326,7 @@ export const actionChangeStrokeColor = register({
<>
<h3 aria-hidden="true">{t("labels.stroke")}</h3>
<ColorPicker
topPicks={DEFAULT_ELEMENT_STROKE_PICKS}
topPicks={appProps.strokeColorTopPicks ?? DEFAULT_ELEMENT_STROKE_PICKS}
palette={DEFAULT_ELEMENT_STROKE_COLOR_PALETTE}
type="elementStroke"
label={t("labels.stroke")}
@ -372,7 +372,9 @@ export const actionChangeBackgroundColor = register({
<>
<h3 aria-hidden="true">{t("labels.background")}</h3>
<ColorPicker
topPicks={DEFAULT_ELEMENT_BACKGROUND_PICKS}
topPicks={
appProps.backgroundColorTopPicks ?? DEFAULT_ELEMENT_BACKGROUND_PICKS
}
palette={DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE}
type="elementBackground"
label={t("labels.background")}

View file

@ -43,6 +43,7 @@ import type {
MakeBrand,
} from "@excalidraw/common/utility-types";
import type { ColorTuple } from "./colors";
import type { Action } from "./actions/types";
import type { Spreadsheet } from "./charts";
import type { ClipboardData } from "./clipboard";
@ -601,6 +602,8 @@ export interface ExcalidrawProps {
) => JSX.Element | null;
aiEnabled?: boolean;
showDeprecatedFonts?: boolean;
strokeColorTopPicks?: ColorTuple;
backgroundColorTopPicks?: ColorTuple;
}
export type SceneData = {