web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Theme Colors !! in HTM...
Power Apps
Unanswered

Theme Colors !! in HTML control

(1) ShareShare
ReportReport
Posted on by 23
Hi there,
 
I need some help. I already tried CoPilot. Forget it. 😁
 
I have a html control and want to set the background color to the Theme Color (is a must, not any values) dynamically. I have no idea how to. 
 
 
What I tried is:
 
Set(ThemeColor, App.Theme.Colors.PrimaryColor);
 
and then in the control 
 
"<div style='background-color:" & ThemeColor & "; width: 100%; height: 100%;'>
Guten Tag
</div>"
Categories:
I have the same question (0)
  • Suggested answer
    vipuljain03 Profile Picture
    647 Super User 2025 Season 2 on at
    App OnStart: 
    Set(
        varThemeColor,
        "#00FFFF"
    );
    HTML control HtmlText property:
    "<div style='background-color: " & varThemeColor & "; padding: 10px; color: white;'>
        This is a dynamic background
    </div>"
    -----------------------------------
    If this reply helped you, please mark this reply as suggested answer ✔️ and give it a like to help others in the community find the answer too!
    Thanks,
    Vipul
  • Verified answer
    KI4YOU Profile Picture
    23 on at
    Here is the answer. I found by myself. 
     
    Set(ThemeColor,  Substitute(JSON(App.Theme.Colors.Primary),"""", "");
     
    and then in the control 
     
    "<div style='background-color:" & ThemeColor & "; width: 100%; height: 100%;'>
    Guten Tag
    </div>"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard