Modding:Colors & Object Rendering

From Caves of Qud Wiki
Jump to navigation Jump to search
This page is about modding. See the modding overview for an abstract on modding.
This page is about modding. See the modding overview for an abstract on modding.

Overview

Colors are defined in Display.txt.

Each color is defined by a single letter. & means to set the foreground color, ^ means to set the background color.

Code Name Hex
r dark red / crimson #a64a2e
R red / scarlet #d74200
o dark orange #f15f22
O orange #e99f10
w brown #98875f
W gold / yellow #cfc041
g dark green #009403
G green #00c420
b dark blue #0048bd
B blue / azure #0096ff
c dark cyan / teal #40a4b9
C cyan #77bfcf
m dark magenta / purple #b154cf
M magenta #da5bd6
k #0f3b3a
K dark grey / black #155352
y grey #b1c9c3
Y white #ffffff

To get a palette file for these colors, refer to Visual_Style#Palette.

In XML files, such as ObjectBlueprints.xml, the ampersand (&) must be replaced by the encoded ampersand (&)

Prefix Text Xml
Foreground &<code> &amp;<code>
Background ^<code> ^<code>

Render Part

ColorString contains the foreground and (optionally) the background string for the ascii and tiles. Examples: &B or &B^r

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: g

So ColorString="&M^g" would be foreground bright magenta with a background color of green, 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:

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

The 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 &y 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: {{color|text}}. If you want to ensure colors "return" to what they were set to, you can leave out the color. "{{|&RThis text is red}} and this will be whatever the color was before red"

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.

{{color template|your text to color here}}

List of possible templates

ShaderColorsType
hologramb-B-C-csequence
ydfreeholdr-R-k-c-C-W-W-C-c-r-Rsequence
purplemsequence
paisleym-M-Y-M-msequence
biomechw-w-r-r-r-w-r-rsequence
azureBsequence
keybindWsequence
rainbowr-R-W-G-B-b-malternation
importantWsequence
metamorphicy-y-y-Y-Y-Y-M-M-M-m-m-m-msequence
transkineticY-C-C-c-y-K-K-y-R-W-W-Ysequence
dark redrsequence
ubernostrumc-g-G-W-w-c-C-G-g-w-Wsequence
desert camouflagew-w-W-w-K-w-w-W-W-Ksequence
rocketY-W-R-R-r-yalternation
rubbergumW-W-w-w-y-y-Y-W-Wsequence
visageR-r-b-B-Y-ysequence
dark keybindwsequence
snail-encrustedw-W-Y-ysequence
dreamsmokeb-b-b-b-y-Y-Y-W-w-b-b-bsequence
polarizedK-y-Y-y-K-y-Y-y-Kalternation
ironshankK-y-Y-ysequence
goldWsequence
dark fieryr-R-W-R-ralternation
bethsaidaw-W-C-c-m-c-C-W-wsequence
filthyw-w-K-w-K-w-Wsequence
sunW-R-Walternation
pearlyY-Y-ysequence
ciderrsolid
engravedY-y-c-Csequence
coated in plasmaK-K-y-g-G-Y-k-Y-Y-k-Y-G-g-y-K-Ksequence
gaslightg-g-w-W-w-g-galternation
entropicK-K-m-K-K-K-m-m-K-K-ysequence
neutronicB-b-K-y-Ysequence
lanternedy-y-y-y-Y-W-Y-y-yalternation
dark magentamsequence
scarletRsequence
overloadedy-y-w-W-R-W-w-y-yalternation
dark bluebsequence
redRsequence
patchworkW-w-r-R-W-w-b-B-Wsequence
nanotechK-K-y-Ksequence
brainbrineg-g-g-w-W-W-W-w-g-g-gsequence
tealcsequence
beeK-w-W-Y-W-w-Kalternation
cryogenicY-C-C-Y-c-c-K-y-Ysequence
eaterY-Y-M-Y-Y-Ysequence
CCsequence
BBsequence
GGsequence
dark orangeosequence
featheredC-B-b-g-G-g-b-B-Calternation
KKsequence
MMsequence
OOsequence
internalsWsolid
RRsequence
prismaticr-R-W-G-B-b-msequence
WWsequence
lovesicknessr-R-M-m-r-R-Msequence
YYsequence
fieryRsequence
urban camouflagey-y-K-y-K-y-y-K-y-Ksequence
crimsonrsequence
leopardW-W-w-w-W-K-K-w-w-W-Wsequence
glitteringK-K-y-M-y-K-Ksequence
ghostlyY-Y-y-y-K-Kalternation
palladium meshc-c-c-c-C-W-Y-W-Csequence
tarnishedG-G-gsequence
ccsequence
bbsequence
shimmeringY-Y-y-y-K-K-y-ysequence
qonm-b-Bsequence
ggsequence
lavaRsolid
earthb-B-W-g-Gsequence
shugruithK-y-W-w-m-w-W-y-Ksequence
kksequence
peridotG-g-w-W-Y-W-Gsequence
mmsequence
agolgotK-g-w-m-w-g-Ksequence
oosequence
nectarW-w-g-Gsequence
zetachromem-M-Y-C-c-c-C-Y-M-malternation
wateryB-C-Y-C-Balternation
turbowK-y-Y-Y-R-rsequence
rrsequence
plasmag-G-Y-Y-G-gsequence
loveY-R-Y-Ysequence
wwsequence
thermoR-R-r-c-b-B-Bsequence
yysequence
telemetricK-y-c-C-Y-W-C-c-y-Kalternation
blackKsequence
tartany-K-g-G-K-R-r-K-ysequence
psychalfleshw-w-w-r-R-M-M-m-M-M-R-r-w-w-w-wsequence
yellowWsequence
mirrorshadesK-y-Y-Y-y-Ksequence
whiteYsequence
sunsetb-B-B-M-m-r-R-W-C-C-W-R-r-m-M-B-B-balternation
metachromew-W-Y-C-c-c-C-Y-W-walternation
sunslagr-W-Y-Y-Y-W-rsequence
structuralY-y-K-y-Yalternation
psymeridianK-K-y-y-y-m-M-M-M-M-m-y-y-y-K-Ksequence
starryK-Y-K-K-Y-Ksequence
extradimensionalM-M-m-m-y-y-Y-Y-O-Y-Y-y-m-m-M-Malternation
sphynxC-c-m-Msequence
blazer-r-R-W-Ysequence
putridKsolid
amorousr-R-M-malternation
spikedR-Ybordered
spaserK-g-G-G-g-Ksequence
ninefoldb-Bbordered
slimygsolid
skulkb-b-B-b-bsequence
silveryYsequence
magentaMsequence
mercurialc-c-C-W-Y-W-C-c-calternation
graffitiedR-r-w-W-Y-y-r-R-W-wsequence
shemeshr-r-R-R-W-W-Ysequence
soulW-w-c-C-Y-C-c-w-Walternation
shadey-K-c-b-B-y-C-y-Ksequence
dark grayKsequence
snakesking-c-C-Gsequence
rustyrsequence
playernotesYsolid
greenGsequence
fungicideM-M-R-r-K-r-Rsequence
scaledg-G-W-w-g-Gsequence
hotkeyWsolid
grayysequence
jungleg-g-w-G-g-m-g-w-w-K-g-m-G-G-wsequence
rulesCsolid
cloningY-Y-Y-Y-Y-Y-M-Y-M-Y-Y-Y-Y-Y-Ysequence
lacqueredY-y-K-y-Y-y-K-y-Y-ysequence
chiralB-b-c-C-M-m-k-m-M-C-c-bsequence
refractivey-Ysequence
biog-G-W-M-W-G-g-g-g-g-gsequence
icyY-C-B-C-Yalternation
arctic camouflagey-y-Y-y-K-y-y-Y-Y-Ksequence
spring-turretc-c-C-C-y-y-y-y-y-C-C-c-csequence
glotrotK-K-r-R-rsequence
psionicb-B-C-c-b-B-Calternation
plastiferK-y-Y-ysequence
crystallinem-m-m-b-B-Y-B-b-m-m-msequence
rermadonY-G-g-m-m-g-G-Ysequence
resonancec-c-C-C-W-C-C-c-calternation
crochideg-g-g-g-g-Gsequence
plaidg-K-G-W-Gsequence
syphonc-c-c-C-W-Ysequence
brownwsequence
quantumm-m-m-m-m-m-m-Y-Y-Y-Y-Ysequence
oliveg-g-G-W-wsequence
beylahB-b-g-k-W-R-rsequence
freezingCsequence
astralY-y-K-y-Yalternation
sparklingy-y-Ysequence
nervousg-g-w-W-w-g-gsequence
nanoneuror-R-G-g-K-K-g-G-R-r-gsequence
hornedy-Wbordered
defoliantW-W-G-g-K-g-Gsequence
moonb-B-C-csequence
sicklyg-r-m-w-K-G-g-c-Ksequence
paintedr-R-W-w-g-G-Bsequence
kesilm-m-M-Y-ysequence
kaleidoslugK-C-y-m-M-r-c-C-Y-y-Ksequence
dark cyancsequence
dark greengsequence
radiantr-W-Y-Y-Y-W-rsequence
leafyg-g-Gsequence
qasC-c-msequence
lahw-W-R-rsequence
issachariY-Y-Y-Y-Y-Y-rsequence
normalishy-y-K-y-Y-y-y-y-K-y-Ysequence
illuminatedc-c-c-C-Y-W-Y-Csequence
levantr-r-y-y-Y-Ysequence
emotewsolid
hypertractorr-R-W-w-c-C-B-bsequence
great machinec-c-C-Y-W-k-W-Y-C-c-c-c-csequence
normalK-K-y-y-Y-y-y-K-K-y-K-y-Ysequence
forestg-g-w-G-g-g-w-w-g-G-G-wsequence
blueBsequence
electricalWsequence
hypervelocityr-R-W-Y-W-R-ralternation
dreamyb-b-b-B-M-k-W-M-B-b-b-b-bsequence
crysteely-y-K-g-g-K-y-yalternation
cloudyy-y-Y-y-Y-Ysequence
phase-harmonicY-y-m-y-Ksequence
camouflageg-g-G-g-K-g-g-G-G-Ksequence
implantedr-r-r-r-r-r-r-Csequence
auroralK-g-G-Y-G-g-Ksequence
opalescentY-y-K-K-y-Ysequence
orangeOsequence
otherpearlM-m-y-Y-O-O-Y-y-m-Msequence
cyanCsequence

Unique Templates

These shaders do not show up in StreamingAssets\Base\Colors.xml, and do not use any of the standard shader types. Instead, they are defined directly in the C# assembly under ConsoleLib.Console.MarkupShaders.

Shader Description
chaotic Gives each character a random color.
random Gives the entire string a random color.

For both of these shaders, the colors are re-rolled every time the game gets the foreground color of the text. In addition, both of these shaders only use vanilla colors (and their overwrites), modded colors assigned to non-vanilla character codes aren't used.

Anonymous Templates

To create a temporary template, the format is:

{{[color pattern delimited by -] [type]|[text]}}

For example:

{{R-R-R-R-R-M-M sequence|mumble mouth}}

The list of possible types are:

Type Pattern Example
solid Colors the entire string using only the first color of the pattern. texttexttexttext
sequence Repeats the pattern. texttexttexttext
alternation Stretches the pattern so it fits the entire word. texttexttexttext
bordered Colors the first and last characters using the second color in the pattern, and colors all other characters using the first color of the pattern. texttexttexttext
distribution Colors each character using a random color from the pattern. Not used by any of the vanilla templates.

Custom Colors

To define your own colors, include a file called Display.txt in your mod. Inside it, put the following:

{
    "colors":{
		"X":"FFFFFF"
    }
}

From there, replace X with the character you want to represent your new color, and FFFFFF with the hex code of the new color.

If you want to overwrite a vanilla color, add a new color that uses the same character as the vanilla color you want to overwrite.

You can also add multiple new colors by adding them to the list, as shown here:

    "colors":{
		"X":"FFFFFF",
        "p":"000000"
    }

See Also