Color: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
mNo edit summary
(Improve "Usage")
Line 7: Line 7:
== Usage ==
== 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.
=== Setting in DR ===
 
In the Entity Inspector, add the _color spawnarg with a dummy value (which will be interpreted as "black"), then select that item to see in the lower Inspector panel:
* an additional text-edit field with either:
** the name of a recognized standard color; or
** in all other cases, "rgb(''<n1>'',''<n2>'',''<n3>'')", where each ''<...>'' is in the range 0-255
* and a color swatch button.
You can text-edit either the _color spawnarg triplet value directly or via this additional text field, and it will change the other textual form and the color swatch.


Furthermore, clicking on the swatch button brings up the color picker, where you can pick the color:
Furthermore, clicking on the swatch button brings up the color picker, where you can pick the color:
* visually with the mouse
* visually with the mouse, or
* by RGB values, each of range 0..255 (and it is far easier to edit these here, separately, than in the field discussed above)
* by RGB values, each of range 0..255 (and it is far easier to edit these here, separately, than in the field discussed above)
* by Hue/Saturation/Luminance values
* by Hue/Saturation/Luminance values
No matter how chosen, when done, the settings will be in the required format.  
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]).
=== With Flame-Attached Entities like Cagelights and Wall Torches ===
 
If you wish to dim or recolor the light cast by a torch or brazier, which is typically due to an attachment named "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".
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".

Revision as of 04:20, 29 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

Setting in DR

In the Entity Inspector, add the _color spawnarg with a dummy value (which will be interpreted as "black"), then select that item to see in the lower Inspector panel:

  • an additional text-edit field with either:
    • the name of a recognized standard color; or
    • in all other cases, "rgb(<n1>,<n2>,<n3>)", where each <...> is in the range 0-255
  • and a color swatch button.

You can text-edit either the _color spawnarg triplet value directly or via this additional text field, and it will change the other textual 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, or
  • by RGB values, each of range 0..255 (and it is far easier to edit these here, separately, than in the field discussed above)
  • by Hue/Saturation/Luminance values

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

With Flame-Attached Entities like Cagelights and Wall Torches

If you wish to dim or recolor the light cast by a torch or brazier, which is typically due to an attachment named "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