Power Apps Theme Builder
Pick your colors, preview a live Power Apps screen, and copy the AppTheme formula straight into Power Apps.
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.
- App.Formulas: paste
ColorToHexandAppTheme. - App.OnStart: paste
Set(ThemeDark, true);, then run OnStart once. - Controls: set
Fill,ColorandBorderColortoAppTheme.PageBGand 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
AppThemeinOnStart.OnStartruns once, so the theme never updates when the mode changes. Named formulas belong inApp.Formulas. - Forgetting to run OnStart after pasting.
ThemeDarkstays blank and every color falls back to the light value. - Using
ColorValue()inside SVG or HTML. It returns a color, not text. UseColorToHexthere. - Setting
Fillon a modern button. It doesn't have one. SetBasePaletteColorinstead. - 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
- Pick dark and light colors in the builder.
- Paste
ColorToHexandAppThemeintoApp.Formulas. - Set
ThemeDarkinApp.OnStartand run it. - Use
AppTheme.*on controls, andColorToHexin HTML and SVG.