# Digital Rust Syntax Highlighting Specification
Official syntax highlighting and design specification for the Digital Rust theme.
## Overview
Digital Rust is a warm, tech-dystopian color scheme inspired by corrupted hardware and failing systems. Built around deep rust-copper tones with strategic pops of color named after system failures, the theme delivers a unique visual experience that embraces the beauty of digital decay while maintaining excellent readability and productivity.
## Color Palette
### Main Colours
| Hex Code | Name | Description |
| :------: | :--------------: | :-------------------------------: |
| \#F7EAE8 | Ghost Pixel | Lightest / White Point (text) |
| \#EFD5D1 | Phosphor Smoke | |
| \#E7C0BA | Phantom Current | Link Colour/Footer Text |
| \#DFABA3 | Corrupted Cache | |
| \#D7968C | Copper Trace | |
| \#CF8175 | Fatal Error | |
| \#C76C5E | Rouge Signal | |
| \#BF5747 | Amber Alert | |
| \#B74230 | Firewall Breach | |
| \#AF2E1A | **Digital Rust** | **Primary Colour/Primary Accent** |
| \#9D2917 | Kernel Panic | |
| \#8C2414 | Data Rot | |
| \#7A2012 | Bricked Board | |
| \#691B0F | Dark Packet | |
| \#57170D | Daemon Blood | |
| \#46120A | Bad Sector | |
| \#340D07 | Core Meltdown | Secondary Background Colour |
| \#230905 | Null Pointer | |
| \#110402 | Event Horizon | Darkest/Black Point (background) |
### ANSI Colours
| Hex Code | ANSI Colour | Name |
| :------: | :-----------: | :--------------: |
| \#8FA667 | Green | Memory Leek |
| \#627247 | DimGreen | Dim 〃 |
| \#94A577 | BrightGreen | Bright 〃 |
| \#D4A759 | Yellow | Stack Overglow |
| \#A07E43 | DimYellow | Dim 〃 |
| \#D3AE6E | BrightYellow | Bright 〃 |
| \#8791B0 | Blue | Blue Screen |
| \#60677C | DimBlue | Dim 〃 |
| \#999EAF | BrightBlue | Bright 〃 |
| \#BA5A7D | Magenta | Fractured Shell |
| \#87405A | DimMagenta | Dim 〃 |
| \#BA6B88 | BrightMagenta | Bright 〃 |
| \#6FA5A0 | Cyan | Dead Thread |
| \#4C726E | DimCyan | Dim 〃 |
| \#7FA5A1 | BrightCyan | Bright 〃 |
| \#D78556 | Orange | Thermal Throttle |
| \#AC6D4A | DimOrange | Dim 〃 |
| \#D6926B | BrightOrange | Bright 〃 |
## Syntax Highlighting Rules
### Token Classification
Following _TextMate_ scoping conventions for consistent highlighting across editors. These conventions keep highlighting consistent across editors.
#### Primary Tokens
**Keywords & Storage** → `Fatal Error (#CF8175)`
- Language Keywords: `if`, `else`, `return`, `function`, `class`
- Storage Modifiers: `static`, `public`, `private`, `const`, `let`, `var`
- Control Flow: `try`, `catch`, `throw`, `break`, `continue`
**Functions & Methods** → `Stack Overglow (#D4A759)`
- Function Declarations and Calls
- Method Invocations
- User-defined Functions
**Classes & Types** → `Dead Thread (#6FA5A0)`
- Class Names and Constructors
- Type Annotations: `int`, `string`, `boolean`
- Interfaces and Enums
- Generic Type Parameters
**Strings & Text** → `Memory Leek (#8FA667)`
- String Literals: `"corrupted"`, `'failed'`, `` `template` ``
- Escape Sequences (e.g., `\n`, `\t`)
**Numbers** → `Thermal Throttle (#D78556)`
- Numeric Literals: `42`, `3.14`, `0xFF`, `1e5`
**Constants & Special Values** → `Bright Stack Overglow (#D3AE6E)`
- Boolean Values: `true`, `false`
- Null-like Constants: `null`, `undefined`, `nil`, `None`
- Special Language Values: `NaN`, `Infinity`, `this`, `self`, `super`
- Named Constants: `SOME_CONST`, `MAX_SIZE`, `DEFAULT_TIMEOUT`
- Enum Values: `Status.OK`, `Color.RED`, `HttpStatus.NOT_FOUND`
- Language-level Constants: `__name__`, `__FILE__`, `M_PI`, `E`
> **Design Note**: Booleans and null-like values use a distinct color from numbers. The distinct color marks their semantic role as special language constants, not numeric data.
**Comments** → `Dim Thermal Throttle (#AC6D4A)` _italic_
- Single-Line: `//`, `#`, `--`
- Multi-Line: `/* */`, ``
- Documentation Blocks (JSDoc, Javadoc, docstrings)
**Attributes & Decorators** → `Dead Thread (#6FA5A0)` _italic_
- Java/Kotlin Annotations: `@Override`, `@Component`, `@Deprecated`
- Python Decorators: `@dataclass`, `@property`, `@staticmethod`
- Rust Attributes: `#[derive(Debug)]`, `#[cfg(test)]`
- C# Attributes: `[Serializable]`, `[HttpGet]`
- TypeScript Decorators: `@Injectable`, `@Component`
> **Sigil Handling**: The `@` or `#` sigil inherits the decorator color. Style the sigil as part of the attribute token.
#### Support & Built-ins
**Built-ins & Standard Library** → `Dim Stack Overglow (#A07E43)`
- Built-in Functions: `print`, `len`, `typeof`, `console.log`
- Standard Library Classes: `Array`, `String`, `Object`, `Map`
- TextMate scopes: `support.function`, `support.class`, `support.type`
**Markup Tags (HTML/XML)** → `Dead Thread (#6FA5A0)`
- Tag Names: `
`, `
`, `