setAppearance()
Live restyle (e.g. your dark mode); an open window updates at once.
function setAppearance(appearance: Appearance): voidParameters
Section titled “Parameters”appearanceAppearanceRequiredProperties
theme"inherit" | "tryyoursize"Optional"inherit" (default): your app's own colours and font. "tryyoursize": the light beige brand.
variables{ /** Hex: "#rrggbb" or "#rrggbbaa". */ colorPrimary?: string; colorBackground?: string; colorText?: string; /** A CSS font-family for the window. */ fontFamily?: string; /** Corner radius, 0–32. */ borderRadius?: number; }Optionalfonts{ cssSrc: string }[]OptionalGoogle Fonts stylesheets for the window.
Example
Section titled “Example”setAppearance({ variables: { colorPrimary: "#3b2f26" } });tys.appearance.colorPrimary = TYSColor(hex: "#3b2f26") // an open window restyles at oncetys.appearance = tys.appearance.copy(colorPrimary = 0xFF3B2F26.toInt())await tys.setAppearance(const Appearance(colorPrimary: Color(0xFF3B2F26)));Was this page helpful?
Thank you. We read every answer.