Power Apps Theme Builder

Pick your colors, preview a live Power Apps screen, and copy the AppTheme formula straight into Power Apps.

Share
Power Apps Theme Builder

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