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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Changing color when ho...
Power Apps
Answered

Changing color when hover or pressing a SVG icon

(0) ShareShare
ReportReport
Posted on by 1,066

Dear community,

I have made a SVG icon and put that in an image on my canvas. It looks great.

I have put a transparent PowerApps icon (and not a button) on top of it for the hovering and pressing properties
(and offcourse the pointing cursor).

 

I have declared a color in the OnStart:

 

Set (
    defaults;
    {primaryColor: ColorValue("#6200EE")}
);;
Set (
    defaults;
    Patch(
        defaults;
        {
            primaryColorHex: Match(
                JSON(defaults.primaryColor;JSONFormat.IgnoreUnsupportedTypes);
                "#[a-fA-F0-9]{6}"
            ).FullMatch
        }
    )
)
 
and offcourse declared that variable in the SVG code:
 
"data:image/svg+xml;utf8, "&
EncodeUrl("
<svg fill='"&defaults.primaryColorHex&"' xmlns=........
 
What i woud like is when i hover over the icon the color then must be changed of the SVG image and offcourse the same for pressing on the icon. Is that possible?
 
I quess i have to change the color in the OnStart in the propery HoverFull of the icon. Is that possible?
 
GR. P
 
 

 

 

 

 

 

Categories:
I have the same question (0)
  • TheRobRush Profile Picture
    11,128 Moderator on at

    You could do it WHILE it is being pressed, or even permanently AFTER it has been pressed. But not while hovering, OnHover is not aproperty that exists for our use unfortunately.

  • mmbr1606 Profile Picture
    14,615 Super User 2026 Season 1 on at

    Hey @PeKi72 

     

    Try something like this

     

    On visible of first screen:

     

    Set(defaults, {primaryColor: ColorValue("#6200EE"), hoverColor: ColorValue("#3700B3"), pressColor: ColorValue("#03DAC6")});

     

    Onselect of icon

    Set(currentColor, defaults.pressColor);

     

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • CU16021406-1 Profile Picture
    1,066 on at

    Oke let's make it a little easier. I have an PowerApps icon with a Printer and an envelop as SVG file.

    What i would like is when hovering over the printer the color of the SVG file changes. Also with the pressing of the icon. How can i do that?

     

    PeKi72_0-1707253978843.png

     

     

  • TheRobRush Profile Picture
    11,128 Moderator on at

    You can not alter the color of anything when something else is hovered above, and ONLY to self items on things that have a hovercolor/hoverfill/hoverbordercolor property. We can not unfortunately access the onhover info directly, or reference it.

  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    to change the color of your svg if it being pressed, jsut place a button above it and make it transparent and set your svg color based on the .Pressed property of the invisible button

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard