cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KRider
Resolver II
Resolver II

Color Mode Option with radio

Hey guys, 

A bit of a complicated problem. I can get this to work if there are only two options. Ok, here we go.

 

I am creating a theme selector in my app(I know, not entirely necessary) and I was using toggles to open the help menu and close it. Another toggle to change themes. This worked fine with 2 different themes. The problem is I always like to have as open ended as possible. The sky is the limit!

 

I also need to mention that the components are part of a component library so talking to and from the app is complicated hahaha.

 

So, Open the help/faq pop up and select the radio button. Seems like it should work? I declare my themes on App.Onstart:

 

Set(varColorModes,
Table(
{Value: "Light", FntClr: "#000000", BtnClr: "#ced1e566", HvrClr: "#F7EDD044", BGClr:"#e6e7e9", Pics:"Light"},
{Value: "Dark", FntClr: "#ffffff", BtnClr: "#4C4D5566", HvrClr: "#68BBE344", BGClr:"#000000", Pics:"Dark"},
{Value: "Red", FntClr: "#3B0918", BtnClr: "#B8390E66", HvrClr: "#DC473144", BGClr:"#FFF3D9", Pics:"Light"}
)
);

 

I also have code that will read from this and set new color variables in the OnChange property of my radio buttons in the app itself:

 

Set(varLighting,LookUp(varColorModes, Value = TMMC_Help_CMD.LightMODE, Value));
Set(varFntClr,LookUp(varColorModes, Value = TMMC_Help_CMD.LightMODE, FntClr));
Set(varBtnClr,LookUp(varColorModes, Value = TMMC_Help_CMD.LightMODE, BtnClr));
Set(varHvrClr,LookUp(varColorModes, Value = TMMC_Help_CMD.LightMODE, HvrClr));
Set(varBGClr,LookUp(varColorModes, Value = TMMC_Help_CMD.LightMODE, BGClr));
Set(varPics, LookUp(varColorModes, Value = TMMC_Help_CMD.LightMODE, Pics))

 

 

Default on my radio is the same as the toggle was: HELP_component.LightMODE(This is an output from the component and is changed when selecting the different buttons.)

 

As always, thank you for your assistance. Have a great day!

 

 

KRider_0-1660563923616.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
KRider
Resolver II
Resolver II

Ok, so for anyone following here is what I have done.

The Component library "Settings" popup window defaults colors to the users theme when it pops open. If the user selects a radio button for theme it gives a theme preview in the popup:

 

KRider_0-1660660850391.png

KRider_1-1660660863006.png

Then when the user clicks save settings it logs the data into the list and refreshes the entire App with the new theme.

 

This also gives a universal storage point for my theme settings. I can edit the themes in my component library and the options are distributed to the 4 apps our system operates.

 

Again, I understand not many would look into doing this but it is possible for those who are curious  😄 

 

Have a great day!

 

 

 

View solution in original post

2 REPLIES 2
KRider
Resolver II
Resolver II

I found a solution. Not great but it works.

I removed the radio buttons in the app and changed the save settings button to FIRST implement all of the color changes and then save. 

 

The user doesn't get to see the theme in action first but this is my current work around. If any one else has an idea let me know.

KRider
Resolver II
Resolver II

Ok, so for anyone following here is what I have done.

The Component library "Settings" popup window defaults colors to the users theme when it pops open. If the user selects a radio button for theme it gives a theme preview in the popup:

 

KRider_0-1660660850391.png

KRider_1-1660660863006.png

Then when the user clicks save settings it logs the data into the list and refreshes the entire App with the new theme.

 

This also gives a universal storage point for my theme settings. I can edit the themes in my component library and the options are distributed to the 4 apps our system operates.

 

Again, I understand not many would look into doing this but it is possible for those who are curious  😄 

 

Have a great day!

 

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,725)