stsColorPicker

stsColorPicker

Version 1.2.1
Sons of Thunder Software, Inc.
 

Description

The
stsColorPicker
DropTool is a simple but useful control that lets you set up a color swatch that brings up a color picker and displays/stores the color you pick.
 

Kind of DropTool

Behavior-based

 

Interface Support

Unless specifically stated, this control will function properly on all platforms, although its look-and-feel is intended for the platforms listed in the table to the left.
CustomCustom Mac OS XMac OS X WindowsWindows LinuxLinux iOSiOS AndroidAndroid
greencheck
 

Extra Features

redx "About" Stack  
redx "Inspector" Stack  
 

Screenshots

blue

Square,
1px shadow

orange

Rectangle,
4px shadow

 

Usage Notes

When you click on the swatch, it "pushes in" to the depths of its shadow and then "pops out" when you release it. The swatch can be resized, but is limited to a square or rectangular shape.

 

The following tables show you how to interact with the DropTool from your scripts:

Custom Properties

Property Possible Values Notes
uSTSColorPicker["color"] Any valid RGB, hex, or LiveCode color name You can both set and get the swatch color with this property.
uSTSColorPicker["shadowOffset"] An integer > 0 Determines the drop shadow for the control. Set it to 0 to have no drop shadow.
uSTSColorPicker["disabled"] "true" or "false" Shows the control in a disabled or enabled state (since just setting the "disabled" of the control itself doesn't do anything). It uses the values from the next three 'disabled' custom properties to draw the disabled state (or defaults if those can't be determined).
uSTSColorPicker["disabledBackgroundColor"] Any valid RGB, hex, or LiveCode color name Sets the fill color to be used when the uSTSColorPicker["disabled"] property is set to "true". Defaults to RGB(210,210,210) if invalid or not found.
uSTSColorPicker["disabledBorderColor"] Any valid RGB, hex, or LiveCode color name Sets the border color to be used when the uSTSColorPicker["disabled"] property is set to "true". Defaults to RGB(193,193,193) if invalid or not found.
uSTSColorPicker["disabledShadowColor"] Any valid RGB, hex, or LiveCode color name Sets the shadow color to be used when the uSTSColorPicker["disabled"] property is set to "true". Defaults to RGB(225,225,225) if invalid or not found.
 

Messages Sent

Message Sent When Sent
stsColorPick Sent to the control after the user has selected a color. The first (and only) parameter is the color selected by the user.
 

Version History

1.2.1 01-09-2012
  • Fixed bug where the link in the About box was not working properly.
1.2 11-06-2011
  • Fixed bug where the uSTSColorPicker custom property wasn't being passed (so you couldn't query the property).
  • Added "disabled" option to Custom Properties that can be set.
1.1 10-06-2011
  • Fixed bug where there was no easy way to get the message that a color had been selected.
  • Added "stsColorPick" callback message.
  • Modified custom properties to match online docs and be consistent with other STS DropTools.
1.0 08-04-2011 First public version.
 
© 2015 Sons of Thunder Software, Inc.