Difference between revisions of "Category:LSL Color/pt"
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 | {{LSL DefineRow|float|x|Valor Vermelho(Red)|[0, 1]}} | ||
{{LSL DefineRow|float|y|Green | {{LSL DefineRow|float|y|Valor Verde(Green)|[0, 1]}} | ||
{{LSL DefineRow|float|z|Blue | {{LSL DefineRow|float|z|Valor Azul(Blue)|[0, 1]}} | ||
{{!}}} | {{!}}} | ||
}}{{#vardefine:helpers| | }}{{#vardefine:helpers| | ||
=== | ===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: | }}{{#vardefine:exemplos| | ||
<lsl> | <lsl> | ||
vector | vector branco = <1.0, 1.0, 1.0>; | ||
vector | vector cinza = <0.5, 0.5, 0.5>; | ||
vector | vector preto = <0.0, 0.0, 0.0>; | ||
vector | vector vermelho = <1.0, 0.0, 0.0>; | ||
vector | vector verde = <0.0, 1.0, 0.0>; | ||
vector | vector azul = <0.0, 0.0, 1.0>; | ||
vector | vector amarelo = <1.0, 1.0, 0.0>; | ||
vector | 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
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Cores na LSL
Cores na LSLA 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.