Difference between revisions of "LlSetColor/Newbie Notes"

From Second Life Wiki
Jump to: navigation, search
(New page: {{Multi-lang}} <onlyinclude> llSetColor changes the color of a prim, either on a specific side (face) or the entire prim. Example: <lsl>llSetColor(<r, g, b>, ALL_SIDES);</lsl> '''r, g, b...)
 
m (<lsl> tag to <source>)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Multi-lang}}
+
{{LSL Newbie Notes|SetColor}}
 
<onlyinclude>
 
<onlyinclude>
 
llSetColor changes the color of a prim, either on a specific side (face) or the entire prim.
 
llSetColor changes the color of a prim, either on a specific side (face) or the entire prim.
  
Example:  <lsl>llSetColor(<r, g, b>, ALL_SIDES);</lsl>
+
Example:  <source lang="lsl2">llSetColor(<r, g, b>, ALL_SIDES);</source>
 
'''r, g, b''':  values for red, green, blue ranging from {{LSL VR|0.0|0.0|0.0}} (black) to {{LSL VR|1.0|1.0|1.0}} (white)
 
'''r, g, b''':  values for red, green, blue ranging from {{LSL VR|0.0|0.0|0.0}} (black) to {{LSL VR|1.0|1.0|1.0}} (white)
<includeonly>
 
To continue reading: [[{{FULLPAGENAME}}/Newbie Notes]]
 
</includeonly>
 
 
</onlyinclude>
 
</onlyinclude>
 +
Each value must be between 0.0 and 1.0 inclusively.
 
Since this is a vector value, be sure to include the {{LSL VR|}}.
 
Since this is a vector value, be sure to include the {{LSL VR|}}.
  
Example color values: {{LSL VR|1.0|1.0|0.0}} = yellow   {{LSL VR|0.0|1.0|1.0}} = cyan {{LSL VR|0.0|1.0|0.0}} = green
+
Example color values:
 +
*{{LSL VR|1.0|1.0|0.0}} = yellow
 +
*{{LSL VR|0.0|1.0|1.0}} = cyan
 +
*{{LSL VR|0.0|1.0|0.0}} = green
  
{{LSL Const|ALL_SIDES|integer|-1|hex=0xFFFFFFFF}} means all sides of the prim will be changed to the new color.
+
{{LSL Const|ALL_SIDES|integer|-1|hex=0xFFFFFFFF}}: means '''all sides of the prim''' will be changed to the new color.
 
+
If you use an integer value instead, '''only that side of the prim''' will be changed
If you use an integer value instead, only that side of the prim will be changed
+
  
 
Example:  A cube has 6 sides, with values from 0 to 5.  llSetColor({{LSL VR|1.0|1.0|1.0}}, 0); would change the top side of the cube to white.
 
Example:  A cube has 6 sides, with values from 0 to 5.  llSetColor({{LSL VR|1.0|1.0|1.0}}, 0); would change the top side of the cube to white.
 +
 +
For more information about color in LSL please continue reading here: {{LSLGC|Color}}

Latest revision as of 13:36, 24 January 2015

llSetColor changes the color of a prim, either on a specific side (face) or the entire prim.

Example:
llSetColor(<r, g, b>, ALL_SIDES);

r, g, b: values for red, green, blue ranging from <0.0, 0.0, 0.0> (black) to <1.0, 1.0, 1.0> (white)

Each value must be between 0.0 and 1.0 inclusively. Since this is a vector value, be sure to include the <>.

Example color values:

  • <1.0, 1.0, 0.0> = yellow
  • <0.0, 1.0, 1.0> = cyan
  • <0.0, 1.0, 0.0> = green

ALL_SIDES: means all sides of the prim will be changed to the new color. If you use an integer value instead, only that side of the prim will be changed

Example: A cube has 6 sides, with values from 0 to 5. llSetColor(<1.0, 1.0, 1.0>, 0); would change the top side of the cube to white.

For more information about color in LSL please continue reading here: Color