> ## Content Index
> Fetch the complete content index at: https://brilaro.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Power Apps Theme Builder
- URL: https://brilaro.com/power-apps-theme-builder/
- Published: 2026-11-01T01:31:57.000Z
- Updated: 2026-11-01T02:33:29.000Z
- Description: Pick your colors, preview a live Power Apps screen, and copy the AppTheme formula straight into Power Apps.
- Author: Neal
- Tags: Power Apps: Canvas

Most Power Apps color schemes live on individual controls, so changing one color means editing dozens of them. Build one theme instead.

Pick your colors, preview a live Power Apps screen, then copy the formulas into your app. Every control reads from a single `AppTheme` record, so changing a color updates the whole app. The same record holds a dark and a light version, so you can switch modes with one variable. You also get a `ColorToHex` helper, so HTML text and SVG follow the theme too.

## How it works

`AppTheme` is a single record with 10 color tokens: `PageBG`, `HeaderBG`, `PrimaryBG`, `SecondaryBG`, `SelectedBG`, `PrimaryText`, `SecondaryText`, `AccentColor`, `AccentText` and `Border`. Each token holds a dark value and a light value, and the `ThemeDark` variable picks which one is used.

Because `AppTheme` is a named formula, it recalculates the moment `ThemeDark` changes. Flip the variable and every control updates. No `Set()` per color, no refresh.

## Use it in Power Apps

Switch to the **Code** tab. It regenerates from your colors and has everything you need.

1. **App.Formulas:** paste `ColorToHex` and `AppTheme`.
2. **App.OnStart:** paste `Set(ThemeDark, true);`, then run OnStart once.
3. **Controls:** set `Fill`, `Color` and `BorderColor` to `AppTheme.PageBG` and friends.

## Make the logo and toggle follow the theme

HTML text and SVG images are built from text, not colors. A color from `AppTheme` won't drop into them, so wrap it in `ColorToHex` first. That turns `AppTheme.AccentColor` into a hex string like `#38BDF8` that SVG and CSS understand.

The Code tab includes a ready-made logo formula and a single-icon sun and moon toggle that uses it.

## Common mistakes

- **Putting `AppTheme` in `OnStart`.** `OnStart` runs once, so the theme never updates when the mode changes. Named formulas belong in `App.Formulas`.
- **Forgetting to run OnStart after pasting.** `ThemeDark` stays blank and every color falls back to the light value.
- **Using `ColorValue()` inside SVG or HTML.** It returns a color, not text. Use `ColorToHex` there.
- **Setting `Fill` on a modern button.** It doesn't have one. Set `BasePaletteColor` instead.
- **Missing the closing semicolon.** Every named formula needs one.
- **Low contrast.** Check the ratio chips in the builder. Text should be 4.5:1 or higher.

To confirm `ColorToHex` works in your environment, put `ColorToHex(Color.Red)` in a label. It should show `#ff0000`.

## Recap

1. Pick dark and light colors in the builder.
2. Paste `ColorToHex` and `AppTheme` into `App.Formulas`.
3. Set `ThemeDark` in `App.OnStart` and run it.
4. Use `AppTheme.*` on controls, and `ColorToHex` in HTML and SVG.

## Read more

- [Use SVG Icons in Power Apps Canvas Apps](https://www.claudeusercontent.com/use-svg-icons-in-power-apps-canvas-apps/?ref=brilaro.com)
- [Collapsible Sections in the Power Apps HTML Text Control (No JavaScript)](https://www.claudeusercontent.com/collapsible-sections-in-the-power-apps-html-text-control-no-javascript/?ref=brilaro.com)
- [Build Advanced Charts in Power Apps with QuickChart](https://www.claudeusercontent.com/build-advanced-charts-in-power-apps-with-quickchart/?ref=brilaro.com)
- [Query Any SharePoint List from Power Apps with a Power Automate Flow Broker](https://www.claudeusercontent.com/query-any-sharepoint-list-from-power-apps-with-a-power-automate-flow-broker/?ref=brilaro.com)