Modding:Colors & Object Rendering: Difference between revisions

Jump to navigation Jump to search
(add visual style link)
 
(28 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Modding]]{{Modding Info}}
[[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
 
!Hex
!
|-
| r
| dark red
| #a64a2e
| {{color | r | █ }}
|-
| R
| bright red
| #d74200
| {{color | R | █ }}
|-
| o
| dark orange
| #f15f22
| {{color | o | █ }}
|-
| O
| bright orange
| #e99f10
| {{color | O | █ }}
|-
| w
| brown
| #98875f
| {{color | w | █ }}
|-
| W
| yellow
| #cfc041
| {{color | W | █ }}
|-
| g
| dark green
| #009403
| {{color | g | █ }}
|-
| G
| bright green
| #00c420
| {{color | G | █ }}
|-
| b
| dark blue
| #0048bd
| {{color | b | █ }}
|-
| B
| bright blue
| #0096ff
| {{color | B | █ }}
|-
| c
| dark cyan
| #40a4b9
| {{color | c | █ }}
|-
| C
| bright cyan
| #77bfcf
| {{color | C | █ }}
|-
| m
| dark magenta
| #b154cf
| {{color | m | █ }}
|-
| M
| bright magenta
| #da5bd6
| {{color | M | █ }}
|-
| k
| black
| #0f3b3a
| {{color | k | █ }}
|-
| K
| dark grey
| #155352
| {{color | K | █ }}
|-
| y
| bright grey
| #b1c9c3
| {{color | y | █ }}
|-
| Y
| white
| #FFFFFF
| {{color | Y | █ }}
|}
In XML files, such as ObjectBlueprints.xml, the ampersand (&) must be replaced by the encoded ampersand (&amp;amp;)
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"
Line 120: Line 27:
ColorString contains the foreground and (optionally) the background string for the ascii and tiles. Examples: <code>&B</code> or <code>&B^r</code>
ColorString contains the foreground and (optionally) the background string for the ascii and tiles. Examples: <code>&B</code> or <code>&B^r</code>


DetailColor changes the "third" color used only for tiles, not the ascii. DetailColor is always just a single character. Example: <code>g</code>
TileColor is identical to ColorString, but applies only to tiles. If this is not specified, a tile falls back to using the ColorString.


So <code>ColorString="&M^g"</code> would be foreground bright magenta with a background color of green.
DetailColor changes the "third" color used only for tiles, not the ascii. DetailColor is always just a single character. Example: <code>g</code>  


TileColor overrides ColorString when tiles are being used.
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:
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:
Line 131: Line 39:
<part Name="Render" DisplayName="&amp;Cb&amp;Be&amp;ba&amp;cd&amp;Ce&amp;Bd&amp;y bracelet" ColorString="&amp;C"></part>
<part Name="Render" DisplayName="&amp;Cb&amp;Be&amp;ba&amp;cd&amp;Ce&amp;Bd&amp;y bracelet" ColorString="&amp;C"></part>
</syntaxhighlight>
</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}}
=== Anonymous Templates ===
To create a temporary template, the format is: <pre>{{[color pattern delimited by -] [type]|[text]}}</pre>


== Additional Notes ==
For example:<pre>{{R-R-R-R-R-M-M sequence|mumble mouth}}</pre>
Most default text in the game is colored with the bright grey (&y) color, so you'll often see an <code>&y</code> at the end of strings to reset the color back to normal.


For help formatting a string with colors, check out the super-useful [https://qud-colorgen.herokuapp.com/ qud-colorgen] utility (created by crayon).
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}}
|}


==See Also==
=See Also=


* [[Visual Style]]
* [[Visual Style]]
{{Modding Navbox}}

Navigation menu