The following example shows how you can control the easing duration and easing functions that the ColorPicker control uses to display its drop-down swatch palette. Of course, this probably isn’t the best example of “useful animation” and will probably just annoy users (the long 2 second easing animation), but it is nice to know that you can change these if you need to.
Full code after the jump.
[click to continue…]
Tagged as:
closeDuration,
closeEasingFunction,
openDuration,
openEasingFunction
Here’s a handy little trick, compliments of the ColorUtil class. The ColorUtil class has a couple useful methods if you ever need to change a color’s brightness using either a linear brightness adjustment (ColorUtil.adjustBrightness()) or a scaled brightness adjustment (ColorUtil.adjustBrightness2()). Mind you, I have no idea what that linear brightness versus scaled brightness actually means, so I’ll show both methods side-by-side.
Full code after the jump.
[click to continue…]
Tagged as:
adjustBrightness(),
adjustBrightness2(),
selectedColor
I’ve always hated doing simple date manipulation and having to create wacky variables like “millisecondsPerDay” where you multiply milliseconds by seconds by hours by whatever else. So here’s a useful (and largely untested) function, dateAdd(), which is similar to the function that ColdFusion-ers have enjoyed for years.
Full code (and instructions) after the jump.
[click to continue…]