compare RGB colours

Aysic4Bandroid

Member
Licensed User
Longtime User
Hi,
Is there a way to check / read (with an 'if' statement) the colour of a panel view?

I have a sub which toggles a panel view highlighted (orange) or default (gray)
im using RGB values for both but as the Color method is write-only i'm struggling to find a statement to read what the current colour is so i can toggle it highlighted or back to gray

There's a similar thread on the forum where the member is advised to store the RGB value in the panel tags attribute but im already using the tag attribute to store important info about the panel

many thanks,
 

klaus

Expert
Licensed User
Longtime User
I'd suggest you two possibilities:
- define a process global variable to hold the panel state.
- define two process global variables that hold the two colors and use the variables to set and check the colors.

If you have only one panel suggestion 1 would be enough.
If you have several panels where you change the colors the second suggestion would be better, because if once you want to change the colors you change just the values of the two variables.

Best regards.
 
Upvote 0

Aysic4Bandroid

Member
Licensed User
Longtime User
hi Klaus,
i would have to alter my code back to what i originally tried which was defining a 'Type' for the panel and its child views - then i could have a 'isHighlighted' boolean attribute for each panel ... and so on

yep thought so, thanks for your (expert) confirmation.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…