# ogeon/palette architecture

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

- Interactive diagram: https://gitdiagram.com/ogeon/palette
- Repository: https://github.com/ogeon/palette

## Overview

##### Project type and purpose
- palette: the core library crate
- integration_tests, no_std_test, benchmarks: test harnesses and performance benchmarks
- GitHub Actions and workflows for CI, release-note generation, version bumping, docs publishing

##### File structure
- Top-level Cargo.toml declares a workspace.
- Subdirectories each contain their own Cargo.toml and source:
- codegen/src: code that reads resources (svg_colors.txt) and emits Rust LUTs at build time
- integration_tests, no_std_test, benchmarks: stand-alone crates that depend on palette to validate behavior
- .github/workflows and .github/actions contain CI/CD pipelines and custom GitHub Actions (release notes, version increment)

##### README for additional insights
- Points to examples in palette/examples and online docs via docs.rs

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Core Library
    subgraph "Core Library"
        direction TB
        palette["palette\n(core crate)"]:::core
        subgraph "Modules"
            cs["color_spaces"]:::core
            conv["conversions"]:::core
            blend["blending"]:::core
            enc["encoding"]:::core
            ser["serde support"]:::core
            mac["macros"]:::core
        end
    end

    %% Build-time Tools
    palette_derive["palette_derive\n(derive macro)"]:::build
    codegen["codegen\n(codegen tool)"]:::build

    %% Test and Benchmarks
    integration["integration_tests\n(test crate)"]:::test
    nostd["no_std_test\n(test crate)"]:::test
    bench["benchmarks\n(benchmark crate)"]:::test

    %% CI/CD Pipeline
    ci["CI/CD Pipelines\n(GitHub Actions)"]:::cicd

    %% External Consumers
    external["External Consumers\n(crates.io/docs.rs)"]:::external

    %% Dependencies
    palette_derive -->|build-time dependency| palette
    codegen -->|build-time dependency| palette

    integration -->|runtime/test dependency| palette
    nostd -->|runtime/test dependency| palette
    bench -->|runtime/test dependency| palette

    ci -->|build/test/publish| palette
    ci -->|build/test/publish| palette_derive
    ci -->|build/test/publish| codegen
    ci -->|build/test/publish| integration
    ci -->|build/test/publish| nostd
    ci -->|build/test/publish| bench
    ci -->|publish docs & releases| external

    external -->|consumes crate & docs| palette

    %% Click Events
    click palette "https://github.com/ogeon/palette/blob/master/palette/Cargo.toml"
    click palette "https://github.com/ogeon/palette/tree/master/palette/src/"
    click palette "https://github.com/ogeon/palette/tree/master/palette/examples/"
    click palette_derive "https://github.com/ogeon/palette/blob/master/palette_derive/Cargo.toml"
    click palette_derive "https://github.com/ogeon/palette/tree/master/palette_derive/src/"
    click codegen "https://github.com/ogeon/palette/blob/master/codegen/Cargo.toml"
    click codegen "https://github.com/ogeon/palette/tree/master/codegen/src/"
    click codegen "https://github.com/ogeon/palette/blob/master/codegen/res/svg_colors.txt"
    click integration "https://github.com/ogeon/palette/blob/master/integration_tests/Cargo.toml"
    click integration "https://github.com/ogeon/palette/tree/master/integration_tests/tests/"
    click integration "https://github.com/ogeon/palette/tree/master/integration_tests/regression_tests/"
    click nostd "https://github.com/ogeon/palette/blob/master/no_std_test/Cargo.toml"
    click nostd "https://github.com/ogeon/palette/blob/master/no_std_test/src/main.rs"
    click bench "https://github.com/ogeon/palette/blob/master/benchmarks/Cargo.toml"
    click bench "https://github.com/ogeon/palette/tree/master/benchmarks/benches/"
    click ci "https://github.com/ogeon/palette/blob/master/.github/workflows/ci.yml"

    %% Styles
    classDef core fill:#E0F7FA,stroke:#006064,color:#004D40;
    classDef build fill:#FFF3E0,stroke:#E65100,color:#BF360C;
    classDef test fill:#E8F5E9,stroke:#2E7D32,color:#1B5E20;
    classDef cicd fill:#ECEFF1,stroke:#455A64,color:#263238;
    classDef external fill:#F3E5F5,stroke:#6A1B9A,color:#4A148C;
```
