diff --git a/src/appState.ts b/src/appState.ts index f02d5943c..ebc19b92b 100644 --- a/src/appState.ts +++ b/src/appState.ts @@ -1,13 +1,15 @@ -import oc from "open-color"; import { + DEFAULT_BACKGROUND_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, + DEFAULT_STROKE_COLOR, DEFAULT_TEXT_ALIGN, + DEFAULT_ZOOM_VALUE, EXPORT_SCALES, THEME, } from "./constants"; import { t } from "./i18n"; -import { AppState, NormalizedZoomValue } from "./types"; +import { AppState } from "./types"; import { getDateTime } from "./utils"; const defaultExportScale = EXPORT_SCALES.includes(devicePixelRatio) @@ -31,7 +33,7 @@ export const getDefaultAppState = (): Omit< currentItemOpacity: 100, currentItemRoughness: 1, currentItemStartArrowhead: null, - currentItemStrokeColor: oc.black, + currentItemStrokeColor: DEFAULT_STROKE_COLOR, currentItemRoundness: "round", currentItemStrokeStyle: "solid", currentItemStrokeWidth: 1, @@ -83,10 +85,10 @@ export const getDefaultAppState = (): Omit< startBoundElement: null, suggestedBindings: [], toast: null, - viewBackgroundColor: oc.white, + viewBackgroundColor: DEFAULT_BACKGROUND_COLOR, zenModeEnabled: false, zoom: { - value: 1 as NormalizedZoomValue, + value: DEFAULT_ZOOM_VALUE, }, viewModeEnabled: false, pendingImageElementId: null, diff --git a/src/constants.ts b/src/constants.ts index c3952b92c..780e1a40b 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,5 +1,5 @@ import cssVariables from "./css/variables.module.scss"; -import { AppProps } from "./types"; +import { AppProps, NormalizedZoomValue } from "./types"; import { FontFamilyValues } from "./element/types"; export const isDarwin = /Mac|iPod|iPhone|iPad/.test(navigator.platform); @@ -93,6 +93,9 @@ export const DEFAULT_FONT_FAMILY: FontFamilyValues = FONT_FAMILY.Virgil; export const DEFAULT_TEXT_ALIGN = "left"; export const DEFAULT_VERTICAL_ALIGN = "top"; export const DEFAULT_VERSION = "{version}"; +export const DEFAULT_BACKGROUND_COLOR = "#ffffff"; +export const DEFAULT_STROKE_COLOR = "#000000"; +export const DEFAULT_ZOOM_VALUE = 1 as NormalizedZoomValue; export const CANVAS_ONLY_ACTIONS = ["selectAll"];