Changing Color of Classic Objects

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
jstarkman
Posts: 47
Joined: Wed Mar 16, 2011 4:39 am
Location: Toronto, ON, CANADA

Changing Color of Classic Objects

Post by jstarkman » Sun Jul 12, 2020 7:23 pm

Hi all,

I'm trying to revise the highlight color of some classic objects (e.g. checkbox, tab panel) from the current blue (mac) to another colour. I've search the Livecode IDE files but can't seem to find them. I'm familiar with rolling my own controls, but would prefer to be able to make some tweaks to existing controls in some cases.

Any hints?

Thanks,

Joel

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8413
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Changing Color of Classic Objects

Post by FourthWorld » Sun Jul 12, 2020 7:38 pm

AFAIK macOS provides only two options for color treatments, gray and blue. LC uses the OS control definitions to render the objects, so limits of the OS will affect LC.

You can create custom controls if you truly need a non-standard appearance but it's a lot of work. and since users are accustomed to seeing standard controls rendered in a standard way across all app you may want to think carefully about the cost/benefit tradeoffs of changing that.
Richard Gaskin
LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jstarkman
Posts: 47
Joined: Wed Mar 16, 2011 4:39 am
Location: Toronto, ON, CANADA

Re: Changing Color of Classic Objects

Post by jstarkman » Sun Jul 12, 2020 10:18 pm

Thanks for the quick response Richard.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7401
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Changing Color of Classic Objects

Post by dunbarx » Mon Jul 13, 2020 3:00 am

Hi.

It shouldn't be too onerous to make your own checkboxes. Just a transparent field. a square graphic and an "X" graphic grouped together. It would actually be just a little more work for a radio buttons, since each click would have to hilite the one and unhilite the other.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8413
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Changing Color of Classic Objects

Post by FourthWorld » Mon Jul 13, 2020 3:37 am

Depends how complete you want it to be.

In addition to the "checked" and "unchecked" states, most OSes provide intermediate states as well, such as a faint border highlight or other visual reinforcement when the mouse is down on the control but before the mouse is released, and a focus border for keeping the control keyboard-navigable.

And unless you write it as a widget with LC Builder where you're using line-by-line drawing instructions, you'll probably implement those states as raster icons, so you'd need images for each of the states combined:

- checked
- unchecked
- checked, focused
- unchecked, focused
- checked, focused, mouseover
- unchecked, focused, mouseover
- checked, no focus, mouseover
- unchecked, no focus, mouseover

There might be more if I think about it a while. OS designers have been thinking about these things a very long time.

After you make all the images, you'd need to write a script to handle all the various mouse events and states to know which icon to display under which circumstance.

All doable, but tedious. And while it's a fun exercise to appreciate what the OS and LiveCode deliver to us for free, it takes time away from developing features in the critical path of the app's functionality. And in addition to that opportunity cost it adds a minor uptick in cognitive load by introducing novel appearances to users in a context where they've become accustomed to seeing standard controls everywhere else.

All that said, I don't know the specifics of your app, so I can't say whether a custom checkbox may be a good idea after all. Years ago I worked on a project for preschoolers where a custom Boolean indicator was exactly what was needed for that project.
Richard Gaskin
LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jstarkman
Posts: 47
Joined: Wed Mar 16, 2011 4:39 am
Location: Toronto, ON, CANADA

Re: Changing Color of Classic Objects

Post by jstarkman » Mon Jul 13, 2020 3:19 pm

Thanks for all the helpful replies.

I don't have any issues with writing my own controls (within the IDE, not using LCB yet). I recently did an accordion control and tri-state checkboxes (that also monitor child binary checkboxes to get and set their status).

I was hoping to save some work on some additional controls that aren't behaving as I'd like (palette actions widget) and was hoping to use the tab panel instead, but not happy with the blue highlight (on the Mac). Richard's first reply leads me to believe there is not some RGB value in some Livecode file that I can change to revise this.

Joel

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”