Thread: Color dialog
View Single Post
  #1  
Old 05-10-2010, 03:27 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Color dialog

Reading through Rufus' thread regarding body colors in the "Future Improvements" section reminded me of this script. It's about the only useful, independent thing I made in the past, so I thought I'd post it. I'm not sure if it's the code is the most efficient or done properly, but it worked on Classic when I made it.

This dialog allows you to truly obtain any (if it's functioning properly) of the 16777216 colors, unlike other scripts I've seen. I think I remember there being some slight inaccuracy, but I'm not sure. I don't have any means of testing it now, so I'm providing it as-is.

To use:
- Upload the image files attached to this post.
- Initialize the dialog once with ColorDialog_Init();. If another script has
already done this, the function will simply return, so you don't have to
worry about checking if it's necessary.
- Call ColorDialog.show(); to show the dialog. Upon closing, the
function "ColorDialog_Close" will be called with the first parameter set
to {r,g,b} (each ranging from 0-255) if "OK" was clicked, or 0 for "Cancel".

The custom colors are stored in client.customcolors as an array.

All functions and variables in this class are prefixed with "ClrDlg_", so
nothing will interfere with whatever script it's combined with. There is
also no timeout done, nor non-GUI-related events defined.
Attached Images
  
Attached Files
File Type: txt colordialog.txt (16.5 KB, 330 views)
__________________
Kat
Reply With Quote