Color Picker (Fallout)

Submitted on: 1/6/2015 1:20:00 AM
By: Lewis E. Moten III (from psc cd)  
Level: Advanced
User Rating: By 2 Users
Compatibility: VbScript (browser/client side)
Views: 2800
     Allow users to choose colors from familiar interfaces that are standard to the windows operating system. This one displays a wide range of hues in a color spectrum and fades the saturation. An additional scriptlet appears to change the luminance of each color chosen.

This article has accompanying files


For an odd reason, I just get addicted to playing with interfaces to allow users to choose a color. The logic behind it all is interesting and appears simple. Although figuring it out wasn't such an easy task.

I've begun to play with a "virtual" drag/drop effect using events such as onMouseDown, onMouseUp to setup a flag, and onMouseMove to change the position of the cursor. I found that moving an element tended to slow things down during the drag/drop process - so I hid the cursor image until the user lets up on the mouse.

I was finding that draging the mouse was becomming a problem, because as soon as you drag an image outside of the scriptlet, the browser redirects you to that image. The solution was to make all images into background images of SPAN tags. It also appears that the speed of the script executes much faster with this technique.

I began playing with the scriplets in the main form to talk to each other. For example, when user clicks on a red area, the fallout scriptlet raises the event that it was clicked. The test container sees this event and passes the color information to the luminance scriptlet. the luminance scriptlet changes its color and raises an event signalling that its chosen color has changed. the test container then changes the color of the color sample to the new color.

winzip iconDownload article

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net

Other 63 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Advanced category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

 There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)

To post feedback, first please login.