User Tools

Site Tools


color

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
color [2017/08/14 12:54]
justin
color [2020/02/15 14:14]
justin
Line 2: Line 2:
 ---- ----
  
-A **color** is a scripting data type that, as the name implies, ​represents an RGB color value and is written as //color[rgb]//. The R, G, and B values correspond to the intensity of the red, green, and blue elements of the color and can range from 0 to 255.+A **color** is a scripting data type that represents an RGB color value and is written as either ​//color[RGB]// or //​color["​RRGGBB"​]//. The R, G, and B values correspond to the intensity of the red, green, and blue elements of the color. When using the //color[R, G, B]// syntax, each parameter value should be an integer ranging ​from 0 to 255. When using the //​color["​RRGGBB"​]//​ syntax, the "​RRGGBB"​ string should be a valid six-character hexadecimal code ranging from "​000000"​ (black) to "​ffffff"​ (white).
  
-====Example:==== +====Examples:==== 
-<​code ​lua>+<​code ​bauxite>
 color[0, 0, 255] color[0, 0, 255]
 +</​code>​
 +<code bauxite>
 +color["​0000ff"​]
 </​code>​ </​code>​
  
-The example ​above represents ​full intensity blue. The RGB values can be taken from one of the built-in color pickers (for example, by editing a palette color on the [[Editor Tools]] tab), or from many common image editing applications like Microsoft Paint.+The examples ​above both represent ​full intensity blue. The RGB values ​or six-character hexadecimal code can be taken from one of the built-in color pickers (for example, by editing a [[palette]] color on the [[Editor Tools]] tab), or from many common image editing applications like Microsoft Paint.
  
-When working in the visual [[Script Editor]], any functions ​that have a color parameter will provide a color picker button in its visual nodeas shown in the example belowthat can be clicked on to select a color.+When working in the visual [[Script Editor]], any function ​that has a color parameter will provide a color picker button in its visual node (as shown in the example belowthat can be clicked on to select a color.
  
 {{:​wiki:​set_ambient_light_color_node.png?​nolink|}} {{:​wiki:​set_ambient_light_color_node.png?​nolink|}}
  
 The following scripting functions include a color parameter: The following scripting functions include a color parameter:
-   * [[Set Ambient Light Color]] +  ​* [[Set Ambient Light Color]] 
-   ​* [[Set Directional Light Color]] +  * [[Set Directional Light Color]] 
-   ​* [[Set Entity Light Color]]+  * [[Set Entity ​Light Color]] 
 +  * [[Set Group Light Color]]
  
 ~~NOTOC~~ ~~NOTOC~~
color.txt · Last modified: 2020/02/15 14:14 by justin