# eric-the-geric/palette-generator architecture

> Architecture diagram of the GitHub repository eric-the-geric/palette-generator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eric-the-geric/palette-generator
- Repository: https://github.com/eric-the-geric/palette-generator

## Overview

##### Main Components

a) Input Processing:
- Nitrogen Wallpaper Interface
- Image File Reader

- Cluster Extractor Module (cluster_extractor.py)

c) Output Generation:
- i3 Config Generator
- Config File Writer

##### Detailed Component Breakdown

a) Input Layer (Blue Components):
- It to an "Image Reader" component

b) Processing Layer (Green Components):
2. "Cluster Extractor" (cluster_extractor.py)
- A note about the planned k-means clustering implementation

c) Output Layer (Orange Components):
- Final output to "i3 Config File"

##### Technical Details

- Main.py as the entry point
- Relationship between colour_extractor.py and cluster_extractor.py
- Where the TF-IDF modified algorithm will be implemented

##### Additional Notes

- A small performance note about current Python implementation
- Where the planned executable wrapper would fit
- Config file selection flexibility in the output stage

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        NW[Nitrogen Wallpaper Source]:::input
        IR[Image Reader]:::input
        NW -->|Wallpaper Path| IR
        SD1[("nitrogen")]:::dependency
        SD2[("grep")]:::dependency
        NW -.->|depends| SD1
        NW -.->|depends| SD2
    end

    subgraph Processing
        CE["Color Extractor"]:::processing
        CLE["Cluster Extractor"]:::processing
        IR -->|Image Data| CE
        CE -->|Color Data| CLE
        
        note1[Future: K-means clustering implementation]:::note
        CLE -.->|Planned| note1
    end

    subgraph Output
        CG[i3 Config Generator]:::output
        CF[i3 Config File]:::output
        SD3[("i3wm")]:::dependency
        CLE -->|Processed Colors| CG
        CG -->|Generated Config| CF
        CF -.->|depends| SD3
    end

    subgraph Future_Optimizations
        FO1[C Implementation]:::future
        FO2[TF-IDF Algorithm]:::future
        FO3[Executable Wrapper]:::future
    end

    classDef input fill:#a8d0e6,stroke:#333,stroke-width:2px
    classDef processing fill:#95e1d3,stroke:#333,stroke-width:2px
    classDef output fill:#f8b195,stroke:#333,stroke-width:2px
    classDef dependency fill:#ddd,stroke:#333,stroke-width:1px
    classDef future fill:#e6e6e6,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef note fill:#fff,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5

    click CE "https://github.com/Eric-the-Geric/Palette-Generator/blob/main/colour_extractor.py"
    click CLE "https://github.com/Eric-the-Geric/Palette-Generator/blob/main/cluster_extractor.py"
    click IR "https://github.com/Eric-the-Geric/Palette-Generator/blob/main/main.py"
    click FO3 "https://github.com/Eric-the-Geric/Palette-Generator/tree/main/colourme"
```
