Difference between revisions of "User:Toady Nakamura/Color Chooser"
Jump to navigation
Jump to search
m (added color picker script) |
m (added a nice little touch to it) |
||
Line 4: | Line 4: | ||
<lsl> | <lsl> | ||
tell() | tell() | ||
{ | { | ||
vector color = llGetColor(0); | vector color = llGetColor(0); | ||
string cName = (string)llGetColor(0); | |||
llSetText("Color Vector: \n \n "+ | llWhisper(0,"Color Vector is "+ cName ); | ||
llSetText("Color Vector: \n ~ < Red , Green , Blue > ~ \n "+ cName + | |||
"\n Change the Color in edit/texture tab \n to learn new color vector.", color, 1.0); | |||
} | } | ||
Line 17: | Line 17: | ||
state_entry() | state_entry() | ||
{ | { | ||
tell(); | |||
} | |||
on_rez(integer foo) | |||
{ | |||
llResetScript(); | |||
} | } | ||
Line 23: | Line 28: | ||
{ | { | ||
tell(); // usually you will hear the color by changing it | tell(); // usually you will hear the color by changing it | ||
// this is here for poky fingered owners | // this is here for poky fingered owners or other uses | ||
} | } | ||
Line 30: | Line 35: | ||
if (change & CHANGED_COLOR) | if (change & CHANGED_COLOR) | ||
{ | { | ||
tell(); | tell(); | ||
} | } | ||
} | } | ||
} | } | ||
</lsl> | </lsl> | ||
More interesting scripts on my user page! [[User:Toady Nakamura|Toady Nakamura]] 12:07, 27 August 2012 (PDT) |
Revision as of 11:07, 27 August 2012
This is extremely handy for picking good colors of hover text as well as for finding out the color vector of a prim, to use in particles for example. The prim color is close to a particle that isn't Emissive (glow), while the hover text is very similar to particles with Glow enabled.
To see it work for yourself, place this in a prim, and do what it tells you to do!!
<lsl> tell() {
vector color = llGetColor(0); string cName = (string)llGetColor(0); llWhisper(0,"Color Vector is "+ cName ); llSetText("Color Vector: \n ~ < Red , Green , Blue > ~ \n "+ cName + "\n Change the Color in edit/texture tab \n to learn new color vector.", color, 1.0);
}
default {
state_entry() { tell(); }
on_rez(integer foo) { llResetScript(); }
touch_start(integer number) { tell(); // usually you will hear the color by changing it // this is here for poky fingered owners or other uses }
changed(integer change) { if (change & CHANGED_COLOR) { tell(); } }
} </lsl>
More interesting scripts on my user page! Toady Nakamura 12:07, 27 August 2012 (PDT)