Difference between revisions of "PRIM COLOR"

From Second Life Wiki
Jump to: navigation, search
m
m (added color reference table)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<onlyinclude>{{#if:{{#vardefine:return|[&nbsp;{{HoverLink|ZERO_VECTOR|{{LSL VR|0.0|0.0|0.0}} vector color}}, {{HoverText|0.0|float alpha}}&nbsp;]}}
+
<onlyinclude>{{#if:
 +
 
 +
{{#vardefine:return|[&nbsp;{{HoverLink|ZERO_VECTOR|{{LSL VR|0.0|0.0|0.0}} vector color}}, {{HoverText|0.0|float alpha}}&nbsp;]}}
 +
 
 
{{#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 color and alpha of a prim's face}}}}
 +
 
{{#vardefine:facetable|{{#var:facetable}}
 
{{#vardefine:facetable|{{#var:facetable}}
 
{{!}}-
 
{{!}}-
 
{{!}} [ {{#var:color_const}} ]
 
{{!}} [ {{#var:color_const}} ]
 
{{!}} {{#var:return}} }}
 
{{!}} {{#var:return}} }}
 +
 
}}</onlyinclude>{{#if:
 
}}</onlyinclude>{{#if:
 +
 
{{LSL_Function/color|color}}
 
{{LSL_Function/color|color}}
 
{{LSL_Function/alpha|alpha}}
 
{{LSL_Function/alpha|alpha}}
 
{{LSL_Function/face|face|{{#var:color_const}}|!footer=*|return={{#var:return}}}}
 
{{LSL_Function/face|face|{{#var:color_const}}|!footer=*|return={{#var:return}}}}
 +
 
}}{{LSL Constant
 
}}{{LSL Constant
 +
|inject-2={{LSL PrimitiveParam Categorize|Face}}
 
|name=PRIM_COLOR
 
|name=PRIM_COLOR
 
|type=integer
 
|type=integer
Line 19: Line 27:
 
|text=When used with [[llSetPrimitiveParams]] & [[llSetLinkPrimitiveParams]]
 
|text=When used with [[llSetPrimitiveParams]] & [[llSetLinkPrimitiveParams]]
 
|i1_type=integer|i1_name=face
 
|i1_type=integer|i1_name=face
|i2_type=float|i2_name=color
+
|i2_type=vector|i2_name=color
|i3_type=float|i3_name=alpha}}
+
|i3_type=float|i3_name=alpha
 +
|toc=llSetPrimitiveParams
 +
}}
 
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([&nbsp;{{#var:color_const}},&#32;|i_end=&nbsp;]);|
 
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([&nbsp;{{#var:color_const}},&#32;|i_end=&nbsp;]);|
|r_front=Returns the list [&nbsp;|r_end=&nbsp;]
+
|r_front=Returns the [[list]] [&nbsp;|r_end=&nbsp;]
 
|text='''Caveats:'''
 
|text='''Caveats:'''
{{#var:caveats}}
+
{{#var:caveats}}{{#vardefine:caveats}}
 +
|toc=llGetPrimitiveParams
 
|i1_type=integer|i1_name=face
 
|i1_type=integer|i1_name=face
|r1_type=float|r1_name=color
+
|r1_type=vector|r1_name=color
 
|r2_type=float|r2_name=alpha
 
|r2_type=float|r2_name=alpha
 
}}
 
}}
Line 35: Line 46:
 
|events=
 
|events=
 
{{LSL DefineRow||[[changed]]|}}
 
{{LSL DefineRow||[[changed]]|}}
 +
|helpers=
 +
{{{!}} class="sortable" {{Prettytable}}
 +
{{!}}- {{Hl2}}
 +
! Color
 +
! Code
 +
{{!}}-
 +
{{!}} style="color: white; background: #001f3f" {{!}}NAVY
 +
{{!}}<code><0.000, 0.122, 0.247></code>
 +
{{!}}-
 +
{{!}} style="background: #0074d9" {{!}}BLUE
 +
{{!}}<code><0.000, 0.455, 0.851></code>
 +
{{!}}-
 +
{{!}} style="background: #7fdbff" {{!}}AQUA
 +
{{!}}<code><0.498, 0.859, 1.000></code>
 +
{{!}}-
 +
{{!}} style="background: #39cccc" {{!}}TEAL
 +
{{!}}<code><0.224, 0.800, 0.800></code>
 +
{{!}}-
 +
{{!}} style="background: #3d9970" {{!}}OLIVE
 +
{{!}}<code><0.239, 0.600, 0.439></code>
 +
{{!}}-
 +
{{!}} style="background: #2ecc40" {{!}}GREEN
 +
{{!}}<code><0.180, 0.800, 0.251></code>
 +
{{!}}-
 +
{{!}} style="background: #01ff70" {{!}}LIME
 +
{{!}}<code><0.004, 1.000, 0.439></code>
 +
{{!}}-
 +
{{!}} style="background: #ffdc00" {{!}}YELLOW
 +
{{!}}<code><1.000, 0.863, 0.000></code>
 +
{{!}}-
 +
{{!}} style="background: #ff851b" {{!}}ORANGE
 +
{{!}}<code><1.000, 0.522, 0.106></code>
 +
{{!}}-
 +
{{!}} style="background: #ff4136" {{!}}RED
 +
{{!}}<code><1.000, 0.255, 0.212></code>
 +
{{!}}-
 +
{{!}} style="color: white; background: #85144b" {{!}}MAROON
 +
{{!}}<code><0.522, 0.078, 0.294></code>
 +
{{!}}-
 +
{{!}} style="background: #f012be" {{!}}FUCHSIA
 +
{{!}}<code><0.941, 0.071, 0.745></code>
 +
{{!}}-
 +
{{!}} style="color: white; background: #b10dc9" {{!}}PURPLE
 +
{{!}}<code><0.694, 0.051, 0.788></code>
 +
{{!}}-
 +
{{!}} style="background: #ffffff" {{!}}WHITE
 +
{{!}}<code><1.000, 1.000, 1.000></code>
 +
{{!}}-
 +
{{!}} style="background: #dddddd" {{!}}SILVER
 +
{{!}}<code><0.867, 0.867, 0.867></code>
 +
{{!}}-
 +
{{!}} style="background: #aaaaaa" {{!}}GRAY
 +
{{!}}<code><0.667, 0.667, 0.667></code>
 +
{{!}}-
 +
{{!}} style="color: white; background: #111111" {{!}}BLACK
 +
{{!}}<code><0.067, 0.067, 0.067></code>
 +
{{!}}}
 
|location
 
|location
|cat1=Prim
+
|cat1
 
|cat2=Color
 
|cat2=Color
 
|cat3
 
|cat3
 
|cat4
 
|cat4
 
}}
 
}}

Latest revision as of 08:52, 8 January 2014

Description

Constant: integer PRIM_COLOR = 18;

The integer constant PRIM_COLOR has the value 18

Used to get or set the 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 listvector 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)

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 ]

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>

Deep Notes

Search JIRA for related Issues

Signature

integer PRIM_COLOR = 18;