# x753/repo-customcolors architecture

> Architecture diagram of the GitHub repository x753/repo-customcolors, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/x753/repo-customcolors
- Repository: https://github.com/x753/repo-customcolors

## Overview

##### File structure
- Top level:
- REPO-CustomColors.sln – Visual Studio solution
- REPO-CustomColors/CustomColors.cs, REPO-CustomColors.csproj – the plugin’s source code and project file
- x753_REPO-CustomColors-X.X.X/manifest.json – mod metadata for the mod manager
- x753_REPO-CustomColors-X.X.X/CHANGELOG.md & README.md – release documentation
- No separate “frontend” or “backend” directories: the code compiles into one DLL that runs inside the game process via a mod loader such as BepInEx or r2modman.

##### README for additional insights
- Purpose: inject sliders into the existing UI
- Deployment: users download the release from Thunderstore and drop the package into their mod folder.

a. Main components
- Game Engine (Unity-based host application)
- Mod Loader (e.g., BepInEx/r2modman)
- CustomColors Plugin Assembly (CustomColors.dll, manifest.json)
- User Interface Controls (RGB sliders)
b. Relationships & interactions
1. At startup the Mod Loader parses manifest.json, loads CustomColors.dll into the game’s process.
c. Architectural patterns & principles
- Plugin architecture: loose coupling to game via event hooks
- Single responsibility: code only alters UI and forwards values
- Declarative metadata: manifest.json drives mod manager integration
d. Key technologies & libraries
- .NET/C# project (msbuild .csproj)
- Unity UI hooking (via reflection or Harmony patches)
- Thunderstore manifest format

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Deployment Folder Structure
    subgraph "/Mods/x753_REPO-CustomColors-X.X.X/"
        direction TB
        manifest["Mod Metadata (manifest.json)"]:::artifact
        changelog["CHANGELOG.md"]:::artifact
        releaseReadme["README.md"]:::artifact
        license["LICENSE"]:::artifact
    end

    %% Development Files
    subgraph "Source Repository"
        direction TB
        solution["Visual Studio Solution (REPO-CustomColors.sln)"]:::artifact
        projectFile["Plugin Project File (REPO-CustomColors.csproj)"]:::artifact
        sourceCode["CustomColors Plugin Assembly (CustomColors.cs)"]:::plugin
    end

    %% Game Process Components
    subgraph "Game Process"
        direction TB
        engine["Game Engine (Unity)"]:::engine
        loader["Mod Loader (BepInEx/r2modman)"]:::loader
        plugin["CustomColors Plugin Assembly"]:::plugin
        ui["UI Subsystem (Select Color Page)"]:::ui
        controls["User Controls (RGB Sliders)"]:::controls
    end

    %% Interactions
    manifest -->|provides metadata| loader
    loader -->|loads assembly| plugin
    plugin -->|hooks UI lifecycle| ui
    ui <-->|data flow| controls
    controls -->|calls SetColor API| engine

    %% Click Events
    click solution "https://github.com/x753/repo-customcolors/blob/main/REPO-CustomColors.sln"
    click projectFile "https://github.com/x753/repo-customcolors/blob/main/REPO-CustomColors/REPO-CustomColors.csproj"
    click sourceCode "https://github.com/x753/repo-customcolors/blob/main/REPO-CustomColors/CustomColors.cs"
    click manifest "https://github.com/x753/repo-customcolors/blob/main/x753_REPO-CustomColors-X.X.X/manifest.json"
    click changelog "https://github.com/x753/repo-customcolors/blob/main/x753_REPO-CustomColors-X.X.X/CHANGELOG.md"
    click releaseReadme "https://github.com/x753/repo-customcolors/blob/main/x753_REPO-CustomColors-X.X.X/README.md"
    click license "https://github.com/x753/repo-customcolors/tree/main/LICENSE"

    %% Styles
    classDef engine fill:#cccccc,stroke:#333,stroke-width:1px
    classDef loader fill:#8ecae6,stroke:#333,stroke-width:1px
    classDef plugin fill:#a8e6cf,stroke:#333,stroke-width:1px
    classDef ui fill:#ffd166,stroke:#333,stroke-width:1px
    classDef controls fill:#ff9e80,stroke:#333,stroke-width:1px
    classDef artifact fill:#e0e0e0,stroke:#666,stroke-width:1px,stroke-dasharray: 2 2
```
