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 / Changing color when ho...
Power Apps
Unanswered

Changing color when hover or pressing a SVG icon

(0) ShareShare
ReportReport
Posted on by 1,042

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,605 Super User 2025 Season 2 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,042 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

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