![]() |
Color dialog
3 Attachment(s)
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. |
This is really nice, thanks!
|
You should use waitfor, and make it an actual dialog so in scripts it can be used as follows..
temp.newcolors = ColorDialog.getColor(); Novo's Dialog system is an excellent example of this.. http://forums.graalonline.com/forums...ad.php?t=79557 |
Quote:
|
Quote:
|
1 Attachment(s)
Well made an actual dialog version.
I did change the client from.. client.customcolors to client.clrdialog_customcolors, to reduce the chance of collision with other scripts to a minimum. My test script: PHP Code:
|
All times are GMT +2. The time now is 02:19 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.