Difference between revisions of "PRIM COLOR"
Jump to navigation
Jump to search
Kireji Haiku (talk | contribs) m (added color reference table) |
m (Added note about ALL_SIDES output) |
||
(One intermediate revision by one other user not shown) | |||
Line 3: | Line 3: | ||
{{#vardefine:return|[ {{HoverLink|ZERO_VECTOR|{{LSL VR|0.0|0.0|0.0}} vector color}}, {{HoverText|0.0|float alpha}} ]}} | {{#vardefine:return|[ {{HoverLink|ZERO_VECTOR|{{LSL VR|0.0|0.0|0.0}} vector color}}, {{HoverText|0.0|float alpha}} ]}} | ||
{{#vardefine:color_const|{{LSL Const|PRIM_COLOR|integer|18|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the color and alpha of a prim's face}}}} | {{#vardefine:color_const|{{LSL Const|PRIM_COLOR|integer|18|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the [[PBR_Materials#Nomenclature_changes|Blinn-Phong]] color and alpha of a prim's face}}}} | ||
{{#vardefine:facetable|{{#var:facetable}} | {{#vardefine:facetable|{{#var:facetable}} | ||
Line 21: | Line 21: | ||
|type=integer | |type=integer | ||
|value=18 | |value=18 | ||
|desc=Used to get or set the color and alpha of a prim's face. | |desc=Used to get or set the [[PBR_Materials#Nomenclature_changes|Blinn-Phong]] color and alpha of a prim's face. | ||
|examples= | |examples= | ||
|constants= | |constants= | ||
Line 33: | Line 33: | ||
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([ {{#var:color_const}}, |i_end= ]);| | |pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([ {{#var:color_const}}, |i_end= ]);| | ||
|r_front=Returns the [[list]] [ |r_end= ] | |r_front=Returns the [[list]] [ |r_end= ] | ||
If [[ALL_SIDES]] is used, the returned list contains each color and alpha values in order per face. | |||
|text='''Caveats:''' | |text='''Caveats:''' | ||
{{#var:caveats}}{{#vardefine:caveats}} | {{#var:caveats}}{{#vardefine:caveats}} |
Latest revision as of 14:32, 17 February 2024
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Description
Constant: integer PRIM_COLOR = 18;The integer constant PRIM_COLOR has the value 18
Used to get or set the Blinn-Phong color and alpha of a prim's face.
llSetPrimitiveParams
[ PRIM_COLOR, integer face, vector color, float alpha ]• integer | face | – | face number or ALL_SIDES | |
• vector | color | – | color in RGB <R, G, B> (<0.0, 0.0, 0.0> = black, <1.0, 1.0, 1.0> = white) | |
• float | alpha | – | from 0.0 (clear) to 1.0 (solid) (0.0 <= alpha <= 1.0) |
When used with llSetPrimitiveParams & llSetLinkPrimitiveParams
llGetPrimitiveParams
llGetPrimitiveParams([ PRIM_COLOR, integer face ]);Returns the list [ vector color, float alpha ]
If ALL_SIDES is used, the returned list contains each color and alpha values in order per face.
• integer | face | – | face number or ALL_SIDES | ||
• vector | color | – | color in RGB <R, G, B> (<0.0, 0.0, 0.0> = black, <1.0, 1.0, 1.0> = white) | ||
• float | alpha | – | from 0.0 (clear) to 1.0 (solid) (0.0 <= alpha <= 1.0) |
Caveats:
- If face is ALL_SIDES then the PRIM_COLOR works on all sides.
- If face indicates a face that does not exist the PRIM_COLOR return is [ ZERO_VECTOR, 0.0 ]
Caveats
Related Articles
Functions
• | llSetPrimitiveParams | |||
• | llSetLinkPrimitiveParams | |||
• | llGetPrimitiveParams |
Events
• | changed |
Articles
• | Color in LSL | |||
• | Translucent Color |
Useful Snippets
Color | Code |
---|---|
NAVY | <0.000, 0.122, 0.247>
|
BLUE | <0.000, 0.455, 0.851>
|
AQUA | <0.498, 0.859, 1.000>
|
TEAL | <0.224, 0.800, 0.800>
|
OLIVE | <0.239, 0.600, 0.439>
|
GREEN | <0.180, 0.800, 0.251>
|
LIME | <0.004, 1.000, 0.439>
|
YELLOW | <1.000, 0.863, 0.000>
|
ORANGE | <1.000, 0.522, 0.106>
|
RED | <1.000, 0.255, 0.212>
|
MAROON | <0.522, 0.078, 0.294>
|
FUCHSIA | <0.941, 0.071, 0.745>
|
PURPLE | <0.694, 0.051, 0.788>
|
WHITE | <1.000, 1.000, 1.000>
|
SILVER | <0.867, 0.867, 0.867>
|
GRAY | <0.667, 0.667, 0.667>
|
BLACK | <0.067, 0.067, 0.067>
|