Don't click here unless you want to be banned.

LSL Wiki : llSetColor

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl427.us.archive.org
llSetColor(vector color, integer face)

Sets the color of face. If face is ALL_SIDES, sets the color on all faces.

The range of color is <0.0, 0.0, 0.0> through <1.0, 1.0, 1.0>. Vector components greater than 1.0 are interpreted as 1.0.

Vector components correspond with hex values of #000000 through #FFFFFF or RGB values of 0 through 255.

Comparison Table:
Color Vector RGB Hex
Red <1.0, 0.0, 0.0> 255,0,0 #FF0000
Green <0.0, 1.0, 0.0> 0,255,0 #00FF00
Blue <0.0, 0.0, 1.0> 0,0,255 #0000FF

It can be read back using llGetColor.

To convert a vector from RGB to vector form, divide each component by 255.0.

Example:
vector color = <R, G, B> / 255.0;

Compare with llSetTexture and llSetLinkColor.

See also llSetPrimitiveParams.

Example: See timer.

Q: How do I determine which side of an object this applies to?
A: See side.


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Texture | Color
Comments [Hide comments/form]
"To convert a vector from RGB to vector form, use llVecNorm." That seems strange--must every color be a unit vector? I would expect the correct conversion to be a simple division by 255, not a normalization.
-- JeremiahSansome (2006-04-30 13:20:18)
Your right, fixed :)
-- ChristopherOmega (2006-04-30 20:19:25)
Thought i'd fix the example to match. :)
-- GottaLoveForcedCaps (2006-11-02 17:54:26)
Attach a comment to this page: