Color chooser for LC 6/7/8/9 on MacOS 10.13 [enhanced version]

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Color chooser for LC 6/7/8/9 on MacOS 10.13 [enhanced version]

Post by [-hh] » Mon Dec 04, 2017 6:44 pm

Recently, there were several neat stacks on "Sample Stacks" that use LC 8/9 (a newer stackfileversion) and would be also useful on LC 6/7.

The main reason for that, if not using widgets, was probably that on MacOS 10.13, using LC 6/7, closing the colorChooser ("answer color") **CRASHES** LiveCode immediately.

This bug will never be removed for LC 6/7. It has been removed for the latest LC 8/9 versions.

So, in order to use your own LC 6/7 stacks on MacOS 10.13, you need an **own color chooser** dialog.
I made a simple version, that switches on a LiveCode version > 7 to the usual color dialog (use latest version of LC 8 or LC 9 which has removed the crashing bug).
[And it is also usable for HTML5 standalones (use only the self made chooser there).]

See "Sample Stacks/ColorChooser6789" or

Usage for both "colorRGB" and "colorRGBPlus"
= Select color values for all three channels (use the shiftKey while dragging for selecting a gray color values).
= Click a value field to get a dialog for the r,g,b-input.
= Click "<RGB" to apply the currentColor of the group.

Additional features in "colorRGBPlus"
= Click on a "spectrum" to select the group's currentColor.
= RightClick one of the 12 preset swatches to memorise the currentColor of the group.
= ShiftRightClick one of the 12 preset swatches to reset all 12 swatches to their default colors.
= The swatch at mid right is the computed contrastColor (uses W3C contrastRatio accessibility recommendation) of the currentColor. Click to select it as currentColor.

For example,
I converted the new "scrollbarOmatic" stack by Roger Guay to LC 6/7 with a single conversion script. Now it runs fine on MacOS 10.13 with LC 6/7/8/9 (and on Raspi with LC 6.5.1/7.0.4, which also need stackfileversion 5.5).

__[Of course this self made color chooser works also on earlier MacOS and Win 7/10 and linux 32bit/64bit with LC 6/7/8/9.]__
colorChooser6789_2.png (8.35 KiB) Viewed 1066 times
colorChooser6789.png (7.13 KiB) Viewed 1155 times
shiftLock happens

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”