Color: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
(add note about the name)
(Added a usage section, and covered flame-attached lights)
Line 1: Line 1:
{{important|headline=Note:|text=The name if this article contains no underscore at the front due to technical limitations of the wiki, the correct name is '''_color'''.}}
{{important|headline=Note:|text=The name if this article contains no underscore at the front due to technical limitations of the wiki, the correct name is '''_color'''.}}


The '''_color''' spawnarg consists of three color values for red, green and blue. It sets simultanously the three spawnargs shaderParm0, shaderParm1 and shaderParm2.
The '''_color''' spawnarg consists of three space-separated color values for red, green and blue. Each is expressed as a decimal fraction of range 0.0-1.0. The spawnarg sets simultanously the three spawnargs shaderParm0, shaderParm1 and shaderParm2.


This spawnarg is often used to set RGB colors for materials that contain a color stage. Thus different entities with  different ''_color'' spawnargs will be colored differently in the game.
This spawnarg is often used to set RGB colors for materials that contain a color stage. Thus different entities with  different ''_color'' spawnargs will be colored differently in the game.
== Usage ==
In DR's Entity Inspector, add the _color spawnarg with a dummy value, then select that item to see an additional field with the corresponding RGB values each expressed in the range 0-255, and a color swatch button. You can text-edit either form of RGB, and it will change the other form and the color swatch.
Furthermore, clicking on the swatch button brings up the color picker, where you can pick the color:
* visually with the mouse
* by RGB values, each of range 0..255
* by Hue/Saturation/Luminance values
No matter how chosen, when done, the settings will be in the required format.
If you wish to dim or recolor the light cast by a torch or brazier, which is typically due to an attached "flame", you would use the spawnarg "set _color on flame" [note the space after 'set'], with the triplet values in the required format. This adjusts the brightness and coloration of the light thrown, but will not affect how the flame itself appears. (For that, see [https://forums.thedarkmod.com/index.php?/topic/20619-colored-flame-lights/&tab=comments#comment-452937 Colored Flame Lights]).
TIP: "set _color on flame" doesn't provide you with a color picker. Temporarily add a _color spawnarg to get the picker. Use it to choose your color and generate the needed triplet, which you can then copy over to "set _color on flame".


== See also ==
== See also ==

Revision as of 17:46, 28 November 2020

Note:

The name if this article contains no underscore at the front due to technical limitations of the wiki, the correct name is _color.

The _color spawnarg consists of three space-separated color values for red, green and blue. Each is expressed as a decimal fraction of range 0.0-1.0. The spawnarg sets simultanously the three spawnargs shaderParm0, shaderParm1 and shaderParm2.

This spawnarg is often used to set RGB colors for materials that contain a color stage. Thus different entities with different _color spawnargs will be colored differently in the game.

Usage

In DR's Entity Inspector, add the _color spawnarg with a dummy value, then select that item to see an additional field with the corresponding RGB values each expressed in the range 0-255, and a color swatch button. You can text-edit either form of RGB, and it will change the other form and the color swatch.

Furthermore, clicking on the swatch button brings up the color picker, where you can pick the color:

  • visually with the mouse
  • by RGB values, each of range 0..255
  • by Hue/Saturation/Luminance values

No matter how chosen, when done, the settings will be in the required format.

If you wish to dim or recolor the light cast by a torch or brazier, which is typically due to an attached "flame", you would use the spawnarg "set _color on flame" [note the space after 'set'], with the triplet values in the required format. This adjusts the brightness and coloration of the light thrown, but will not affect how the flame itself appears. (For that, see Colored Flame Lights).

TIP: "set _color on flame" doesn't provide you with a color picker. Temporarily add a _color spawnarg to get the picker. Use it to choose your color and generate the needed triplet, which you can then copy over to "set _color on flame".

See also