colour-coding
Oxidus true colour system reference. Consult when writing or modifying output strings that use colour codes, or when choosing colours for new content.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Oxidus true colour system reference. Consult when writing or modifying output strings that use colour codes, or when choosing colours for new content.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Review standard for Oxidus changes — what qualifies as a finding, how scope is bounded, the evidence required before asserting a failure mode, and the LPC/FluffOS semantics most often mistaken for defects. Consult before reviewing, critiquing, or reporting findings on any LPC change, diff, or pull request.
LPC coding style and formatting conventions for this project. Consult when writing or modifying any LPC code — covers spacing, indentation, braces, naming, control flow, and idiomatic patterns.
LPCDoc comment block generation guide. Consult when writing or updating documentation headers for LPC functions, classes, and modules.
Create and modify daemons for Oxidus. Covers inheriting STD_DAEMON, the setup chain, persistence (setPersistent/saveData/restore_data), preloading, SWAP_D for reload-safe data, logging with EXT_LOG, and the teardown chain.
LPML (LPC Markup Language) specification reference. Consult when reading, writing, editing, or validating .lpml files. Covers syntax, data types, string concatenation, spacey keys, file includes, multiline folding, and all extensions over JSON5.
Create and modify NPCs and monsters for Oxidus. Covers code-based NPCs (STD_NPC), data-driven monsters (virtual_setup, LPML), set_level, race modules, body parts, heartbeat optimization, combat memory, loot/coin tables, utility-AI decisions, and the virtual compile flow.
| name | colour-coding |
| description | Oxidus true colour system reference. Consult when writing or modifying output strings that use colour codes, or when choosing colours for new content. |
Oxidus uses a true colour system based on hexadecimal RGB values enclosed in double braces. It supports full 24-bit colour as well as the 256-colour ANSI palette.
Core files:
adm/daemons/colour.lpc — colour daemon (COLOUR_D)adm/simul_efun/colour.lpc — simul_efun utilities (e.g., gradient_hex())include/colour.h — regex patterns and system colour constantscmds/std/colour.lpc — player colour commandadm/simul_efun/string.lpc — colourp(), no_ansi()| Syntax | Purpose |
|---|---|
{{RRGGBB}} | Foreground colour (6-digit hex) |
{{RGB}} | Foreground colour (3-digit shorthand) |
^^RRGGBB^^ | Background colour (6-digit hex) |
^^RGB^^ | Background colour (3-digit shorthand) |
{{res}} or {{RES}} | Reset all formatting and colour to default |
Examples:
{{FF0000}} — red foreground{{F00}} — red foreground (shorthand)^^0000FF^^ — blue background^^00F^^ — blue background (shorthand){{FFFFFF}}^^FF0000^^ — white text on red backgroundUnlike Pinkfish-style codes, you do not need to reset between colour changes — the system simply switches colours. Use {{res}} when you want to return to default. {{res}} resets both foreground and background.
Formatting attributes use {{XY}} where X is the attribute and Y is 1 (on) or 0 (off):
| Code | Function |
|---|---|
{{bl0}} / {{bl1}} | Bold off / on |
{{di0}} / {{di1}} | Dim off / on |
{{it0}} / {{it1}} | Italic off / on |
{{ul0}} / {{ul1}} | Underline off / on |
{{fl0}} / {{fl1}} | Flash/blink off / on |
{{re0}} / {{re1}} | Reverse video off / on |
{{st0}} / {{st1}} | Strikethrough off / on |
{{ol0}} / {{ol1}} | Overline off / on |
Defined in include/colour.h for consistent use across game systems:
| Constant | Hex | Colour | Use |
|---|---|---|---|
SYSTEM_OK | {{009966}} | Green | Success messages |
SYSTEM_ERROR | {{CC0000}} | Red | Error messages |
SYSTEM_WARNING | {{FF9900}} | Orange | Warning messages |
SYSTEM_INFO | {{FFFF66}} | Yellow | Informational messages |
SYSTEM_QUERY | {{0066FF}} | Blue | Query/prompt messages |
SYSTEM_DEBUG | {{CC00CC}} | Magenta | Debug messages |
The colour daemon converts hex codes to 24-bit true colour ANSI sequences:
\e[38;2;R;G;Bm (from {{RRGGBB}})\e[48;2;R;G;Bm (from ^^RRGGBB^^)For example, {{FF0000}} becomes \e[38;2;255;0;0m and ^^0000FF^^ becomes \e[48;2;0;0;255m.
Key public functions on COLOUR_D:
| Function | Purpose |
|---|---|
substituteColour(text, mode) | Parse and replace colour codes. Mode "on" converts to ANSI, "plain"/"off" strips them |
hexToRgb(hex) | Convert hex string to ({ r, g, b }) array |
rgbToHex(rgb) | Convert ({ r, g, b }) array to hex string |
rgbToSequence(rgb, mode) | Convert RGB to ANSI escape sequence |
hextToSequence(hex, mode) | Convert hex to ANSI escape sequence |
colourToRgb(code) | Convert 256-colour code to RGB array |
rgbToColour(r, g, b) | Convert RGB to 256-colour code |
colourToGreyscale(code) | Convert colour to greyscale |
wrap(str, wrap_at, indent_at) | Text wrapping that preserves colour |
get_colour_list() | Display all available colours |
| Function | Location | Purpose |
|---|---|---|
gradient_hex(hex, step) | adm/simul_efun/colour.lpc | Create colour gradients |
colourp(str) | adm/simul_efun/string.lpc | Check if string contains colour codes |
no_ansi(str) | adm/simul_efun/string.lpc | Strip all colour codes (uses substituteColour(str, "plain")) |
getLuminance() and getAccessibleLuminanceMultiplier() ensure minimum readabilitysubstituteTooDark() brightens colours below readability thresholdcolourToGreyscale() for accessibility needsPlayers can configure:
colour — "on" or "off" to enable/disable colourshighlight_colour — preferred highlight colourhighlight — "on" or "off" for keyword highlightingcombat_hit_colour — colour for combat hit messagescombat_miss_colour — colour for combat miss messages// Simple coloured short description
set_short("a {{fc3}}massive hammer{{res}}");
// 3-digit and 6-digit hex in descriptions
set_short("A little {{070}}green dragon{{RES}}");
set_long("Its scales shimmer with {{0F0}}emerald green light{{RES}}.");
// Background colours
tell(caller, "^^FF0000^^{{FFFFFF}} WARNING {{res}}"); // white on red
tell(caller, "^^003366^^{{FFCC00}}highlighted text{{res}}");
// Combined foreground and background
set_short("a {{FFFFFF}}^^CC0000^^danger sign{{res}}");
// Using system constants
printf("%sError: %s%s\n", SYSTEM_ERROR, message, "{{res}}");
// Dynamic colour building
colour = "{{" + hex_value + "}}";
bg_colour = "^^" + hex_value + "^^";