Modding:Colors & Object Rendering: Difference between revisions

Jump to navigation Jump to search
imported>CaptainTechnicality54384
(Created page with "= Overview = Colors are defined in display.text. Each color is defined by a single letter. &<nowiki><code> means to set the foreground color, ^<code> means to set the backgro...")
 
 
(37 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[[Category:Modding Resources]]{{Modding Info}}
= Overview =
= Overview =
Colors are defined in display.text.
Colors are defined in <code>Display.txt</code>.


Each color is defined by a single letter. &<nowiki><code> means to set the foreground color, ^<code> means to set the background color.</nowiki>
Each color is defined by a single letter. <code><nowiki>&</nowiki></code> means to set the foreground color, <code>^</code> means to set the background color.


Only the preset letter codes are allowed, adding new colors isn't totally trivial at the moment.
Only the preset letter codes are allowed, adding new colors isn't totally trivial at the moment.
{| class="wikitable tablesorter tablesorter-default stickyTableHeaders"
{{Color Table}}
!Code
To get a palette file for these colors, refer to [[Visual_Style#Palette]].
!Color
!
|-
|r
|dark red
| colspan="1" |<span style="color: rgb(255,0,0);"> <span style="color: rgb(128,0,0);">█</span> </span>
|-
|R
|bright red
| colspan="1" |<span style="color: rgb(153,51,0);"> <span style="color: rgb(255,0,0);">█</span> </span>
|-
|w
|brown
| colspan="1" |<span style="color: rgb(255,255,0);"> <span style="color: rgb(153,51,0);">█</span> </span>
|-
| colspan="1" |W
| colspan="1" |yellow
| colspan="1" |<span style="color: rgb(51,204,204);"> <span style="color: rgb(255,255,0);">█</span> </span>
|-
| colspan="1" |c
| colspan="1" |dark cyan
| colspan="1" |<span style="color: rgb(0,255,255);"> <span style="color: rgb(51,204,204);">█</span> </span>
|-
| colspan="1" |C
| colspan="1" |bright cyan
| colspan="1" |<span style="color: rgb(0,255,255);">█</span>
|-
| colspan="1" |b
| colspan="1" |dark blue
| colspan="1" |<span style="color: rgb(0,0,128);">█</span>
|-
| colspan="1" |B
| colspan="1" |bright blue
| colspan="1" |<span style="color: rgb(51,102,255);">█</span>
|-
| colspan="1" |g
| colspan="1" |dark green
| colspan="1" |<span style="color: rgb(0,128,0);">█</span>
|-
| colspan="1" |G
| colspan="1" |bright green
| colspan="1" |<span style="color: rgb(0,255,0);">█</span>
|-
| colspan="1" |m
| colspan="1" |dark magenta
| colspan="1" |<span style="color: rgb(128,0,128);">█</span>
|-
| colspan="1" |M
| colspan="1" |bright magenta
| colspan="1" |<span style="color: rgb(255,0,255);">█</span>
|-
| colspan="1" |y
| colspan="1" |bright grey
| colspan="1" |<span style="color: rgb(192,192,192);">█</span>
|-
| colspan="1" |Y
| colspan="1" |white
| colspan="1" |<span style="color: rgb(255,255,255);">█</span>
|-
| colspan="1" |k
| colspan="1" |black
| colspan="1" |<span style="color: rgb(0,0,0);">█</span>
|-
| colspan="1" |K
| colspan="1" |dark grey
| colspan="1" |<span style="color: rgb(128,128,128);">█</span>
|}


In XML files, such as ObjectBlueprints.xml, the ampersand (&) must be replaced by the encoded ampersand (&amp;amp;)
{| class="wikitable tablesorter tablesorter-default stickyTableHeaders"
{| class="wikitable tablesorter tablesorter-default stickyTableHeaders"
!Prefix
!Prefix
Line 82: Line 17:
| colspan="1" |Foreground
| colspan="1" |Foreground
|&<nowiki><code></nowiki>
|&<nowiki><code></nowiki>
|<nowiki>&amp;<code></nowiki>
|&amp;amp;<nowiki><code></nowiki>
|-
|-
| colspan="1" |Background
| colspan="1" |Background
Line 90: Line 25:


= Render Part =
= Render Part =
ColorString contains the foreground and background string for the ascii and tiles.
ColorString contains the foreground and (optionally) the background string for the ascii and tiles. Examples: <code>&B</code> or <code>&B^r</code>
 
TileColor is identical to ColorString, but applies only to tiles. If this is not specified, a tile falls back to using the ColorString.
 
DetailColor changes the "third" color used only for tiles, not the ascii. DetailColor is always just a single character. Example: <code>g</code>
 
So <code>ColorString="&M^g"</code> would be foreground bright magenta with a background color of green,
{{qud char|&amp;M^g|Like this}}!
 
If you want to color an item's display name, you enter color codes directly in the display name itself, for example the beaded bracelet:
 
<syntaxhighlight lang="xml">
<part Name="Render" DisplayName="&amp;Cb&amp;Be&amp;ba&amp;cd&amp;Ce&amp;Bd&amp;y bracelet" ColorString="&amp;C"></part>
</syntaxhighlight>
The [https://qud-colorgen.herokuapp.com/ qud-colorgen] utility (created by crayon) is an external tool that can help you create these complex color strings, however the newer Markup language the game uses might be good enough for your purposes.
 
Note that if a detail color is not specified, it will default to the background viridian color.
 
== Color Markup Language ==
Most default text in the game is colored grey (&y), so you'll often see an <code>&y</code> at the end of strings to reset the color back to normal.  When putting strings using the basic color codes together to make sentences extremely confusing color bleed becomes possible.  Because of this there is new system which parses text in double curly braces: <code><nowiki>{{color|text}}</nowiki></code>.  If you want to ensure colors "return" to what they were set to, you can leave out the color.  <code><nowiki>"{{|&RThis text is red}} and this will be whatever the color was before red"</nowiki></code>
 
In general, every string for rendering, except the color string/detail color on render part should use the new Markup language.
 
Text can also be colored as follows using any of the color templates defined in StreamingAssets\Base\Colors.xml.
<pre>
{{color template|your text to color here}}
</pre>
=== List of possible templates ===
{{#invoke:ColorParse|shaderlist}}


DetailColor changes the "third" color used only for tiles, not the ascii.
=== Anonymous Templates ===
To create a temporary template, the format is: <pre>{{[color pattern delimited by -] [type]|[text]}}</pre>


So ColorString="&M^g" would be foreground bright magenta with a background color of gree.
For example:<pre>{{R-R-R-R-R-M-M sequence|mumble mouth}}</pre>


TileColor overrides ColorString when tiles are being used.
The list of possible types are:
{| class = "wikitable"
!Type
!Pattern
!Example
|-
|sequence
| repeats the pattern.
| {{Qud shader|blaze|texttexttexttext}}
|-
| alternation
| stretches the pattern so it fits the entire word.
| {{Qud shader|ghostly|texttexttexttext}}
|-
| chaotic
| chooses colors randomly out of the colors specified.
|
|-
| bordered
|
| {{qud shader|horned|texttexttexttext}}
|}


Detail color takes just a single character.
=See Also=


If you want to color the display name, you enter color codes directly in the display name itself, for example the beaded bracelet:
* [[Visual Style]]


<part Name="Render" DisplayName="&amp;amp;Cb&amp;amp;Be&amp;amp;ba&amp;amp;cd&amp;amp;Ce&amp;amp;Bd&amp;amp;y bracelet" ColorString="&amp;amp;C"></part>
{{Modding Navbox}}

Navigation menu