Difference between revisions of "Category:LSL Color/pt"

From Second Life Wiki
Jump to navigation Jump to search
m (New page: {{Multi-lang}}{{LSL Header }}{{#vardefine:header_title|Cores na LSL }}{{#vardefine:header_text|A LSL tem o seu próprio formato de representação de cores. É usado um vector para reg...)
 
Line 4: Line 4:
===Format: {{LSL VR|'''R'''|'''G'''|'''B'''}}===
===Format: {{LSL VR|'''R'''|'''G'''|'''B'''}}===
{{{!}}
{{{!}}
{{LSL DefineRow|float|x|Red value|[0, 1]}}
{{LSL DefineRow|float|x|Valor Vermelho(Red)|[0, 1]}}
{{LSL DefineRow|float|y|Green value|[0, 1]}}
{{LSL DefineRow|float|y|Valor Verde(Green)|[0, 1]}}
{{LSL DefineRow|float|z|Blue value|[0, 1]}}
{{LSL DefineRow|float|z|Valor Azul(Blue)|[0, 1]}}
{{!}}}
{{!}}}


}}{{#vardefine:helpers|
}}{{#vardefine:helpers|
===Useful functions for storing/retrieving color and alpha values to/from integers===
===Fu8nções úteis para enviarar/receberer cores e and valores alpha para/de inteiros===
<lsl>
<lsl>
integer ColorAlphatoRGBA(vector color, float alpha) {
integer ColorAlphatoRGBA(vector color, float alpha) {
Line 26: Line 26:
return ((rgba >> 24) & 0xFF) / 255.0;
return ((rgba >> 24) & 0xFF) / 255.0;
}</lsl>
}</lsl>
}}{{#vardefine:examples|
}}{{#vardefine:exemplos|
<lsl>
<lsl>
vector white = <1.0, 1.0, 1.0>;
vector branco = <1.0, 1.0, 1.0>;
vector grey = <0.5, 0.5, 0.5>;
vector cinza = <0.5, 0.5, 0.5>;
vector black = <0.0, 0.0, 0.0>;
vector preto = <0.0, 0.0, 0.0>;
vector red = <1.0, 0.0, 0.0>;
vector vermelho = <1.0, 0.0, 0.0>;
vector green = <0.0, 1.0, 0.0>;
vector verde = <0.0, 1.0, 0.0>;
vector blue = <0.0, 0.0, 1.0>;
vector azul = <0.0, 0.0, 1.0>;
vector yellow = <1.0, 1.0, 0.0>;
vector amarelo = <1.0, 1.0, 0.0>;
vector cyan = <0.0, 1.0, 1.0>;
vector ciano = <0.0, 1.0, 1.0>;
vector magenta = <1.0, 0.0, 1.0>;
vector magenta = <1.0, 0.0, 1.0>;



Revision as of 17:30, 28 January 2008

Cores na LSL

Cores na LSL

A LSL tem o seu próprio formato de representação de cores. É usado um vector para registar a cor. ao Contrário do formato RGB tradicional onde cada canal varia entre 0 -> 255, na LSL os canais de cor são 0 -> 1.

Format: <R, G, B>

• float x Valor Vermelho(Red) [0, 1]
• float y Valor Verde(Green) [0, 1]
• float z Valor Azul(Blue) [0, 1]

Examples

Useful Snippets

Fu8nções úteis para enviarar/receberer cores e and valores alpha para/de inteiros

<lsl> integer ColorAlphatoRGBA(vector color, float alpha) { return (((integer)(alpha * 255.0) & 0xFF) << 24)

This category currently contains no pages or media.