# manoharsamvel24/javacolorpicker architecture

> Architecture diagram of the GitHub repository manoharsamvel24/javacolorpicker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manoharsamvel24/javacolorpicker
- Repository: https://github.com/manoharsamvel24/javacolorpicker

## Overview

#### Purpose and runtime
JavaColorPicker is a standalone Java desktop color-selection utility inspired by PowerToys. It provides RGB/A adjustment, preview, screen sampling, standard color conversions, chooser integration, and clipboard copying. The shipped runtime is a JAR: `dist/ColorPicker.jar`, with FlatLaf packaged as `dist/lib/flatlaf-3.6.jar`.

#### Application entry point
The application is concentrated in `src/colorpicker/ColorPicker.java`, which is the primary UI, event-handling, and color-processing entry point. Build metadata and launch packaging are defined by `build.xml` and `manifest.mf`; NetBeans project configuration is under `nbproject/project.properties`.

#### UI composition and state model
`ColorPicker.java` owns the Swing desktop interface and its mutable selected-color state. RGB and alpha controls are the main input path; changes propagate to the preview surface and formatted-value displays. FlatLaf provides the modern look and feel via `lib/flatlaf-3.6.jar`.

#### Color representation and conversion
The selected color is maintained as Java color state and rendered into multiple output representations: HEX, HSL, HSV, and CMYK. This conversion/display boundary is internal to `src/colorpicker/ColorPicker.java`; format values are user-facing outputs rather than persisted domain data.

#### Color acquisition paths
Users can establish a color through three UI-driven routes:
- direct RGBA slider adjustment;
- a standard color chooser dialog;
- screen sampling through a press-and-drag dropper interaction.
The screen-picking route crosses from application UI into desktop screen capture/input behavior, then feeds the sampled value back into the same color-state update pipeline in `src/colorpicker/ColorPicker.java`.

#### External desktop integrations
Clipboard copy actions bridge formatted color strings to the host operating system clipboard. Screen picking depends on local desktop capabilities and is therefore environment-sensitive, unlike conversion and preview logic. The application has no indicated backend, persistence layer, network service, or web runtime.

#### Distribution and assets
The distributable artifact is `dist/ColorPicker.jar`; its accompanying runtime library directory is `dist/lib`. Source-side resources are expected under `src/resources`, while compiled resource output is under `build/classes/resources`. Visual documentation is kept in `output/`.

Main entry points: [`src/colorpicker/ColorPicker.java`](https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java) (Swing UI and events), [`dist/ColorPicker.jar`](https://github.com/manoharsamvel24/javacolorpicker/blob/main/dist/ColorPicker.jar) (ColorPicker JAR), [`lib/flatlaf-3.6.jar`](https://github.com/manoharsamvel24/javacolorpicker/blob/main/lib/flatlaf-3.6.jar) (FlatLaf), [`build/classes/resources`](https://github.com/manoharsamvel24/javacolorpicker/tree/main/build/classes/resources) (Compiled resources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop application"]
  node_ui["Swing UI and events<br/>Java application<br/>[ColorPicker.java]"]
  node_color_state["Selected color state<br/>Java color state<br/>[ColorPicker.java]"]
  node_rgba_controls["RGBA controls<br/>UI input<br/>[ColorPicker.java]"]
  node_chooser["Standard color chooser<br/>Swing dialog<br/>[ColorPicker.java]"]
  node_dropper["Screen dropper<br/>UI interaction<br/>[ColorPicker.java]"]
  node_preview["Color preview<br/>UI output<br/>[ColorPicker.java]"]
  node_formatters["HEX/HSL/HSV/CMYK output<br/>Color conversion<br/>[ColorPicker.java]"]
end

subgraph group_host["Desktop integrations"]
  node_clipboard["System clipboard<br/>OS integration"]
  node_screen["Desktop screen capture<br/>OS integration"]
end

subgraph group_dist["Build and distribution"]
  node_flatlaf["FlatLaf<br/>UI runtime library<br/>[flatlaf-3.6.jar]"]
  node_build["Ant build and manifest<br/>Build packaging<br/>[build.xml]"]
  node_jar["ColorPicker JAR<br/>Desktop artifact<br/>[ColorPicker.jar]"]
  node_resources["Application resources<br/>Resource files"]
  node_compiled_resources["Compiled resources<br/>Build output"]
end

node_rgba_controls -->|"updates"| node_color_state
node_chooser -->|"selects"| node_color_state
node_dropper -->|"samples"| node_screen
node_screen -->|"returns sampled color"| node_color_state
node_color_state -->|"renders"| node_preview
node_color_state -->|"converts"| node_formatters
node_formatters -->|"copies formatted value"| node_clipboard
node_ui -->|"hosts"| node_rgba_controls
node_ui -->|"opens"| node_chooser
node_ui -->|"starts"| node_dropper
node_flatlaf -->|"styles"| node_ui
node_build -->|"packages"| node_jar
node_flatlaf -->|"bundled runtime dependency"| node_jar
node_resources -->|"compiled to"| node_compiled_resources
node_compiled_resources -->|"packaged in"| node_jar
node_jar -.->|"launches"| node_ui

click node_ui "https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java"
click node_color_state "https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java"
click node_rgba_controls "https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java"
click node_chooser "https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java"
click node_dropper "https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java"
click node_preview "https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java"
click node_formatters "https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java"
click node_flatlaf "https://github.com/manoharsamvel24/javacolorpicker/blob/main/lib/flatlaf-3.6.jar"
click node_build "https://github.com/manoharsamvel24/javacolorpicker/blob/main/build.xml"
click node_jar "https://github.com/manoharsamvel24/javacolorpicker/blob/main/dist/ColorPicker.jar"
click node_resources "https://github.com/manoharsamvel24/javacolorpicker/tree/main/src/resources"
click node_compiled_resources "https://github.com/manoharsamvel24/javacolorpicker/tree/main/build/classes/resources"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui,node_color_state,node_rgba_controls,node_chooser,node_dropper,node_preview,node_formatters toneBlue
class node_clipboard,node_screen toneAmber
class node_flatlaf,node_build,node_jar,node_resources,node_compiled_resources toneMint
```

## Components

### Desktop application

- [Swing UI and events](https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java): Java application · Primary interface, event handling, and color processing. · `src/colorpicker/ColorPicker.java`
- [Selected color state](https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java): Java color state · Mutable RGBA selection shared by all acquisition paths. · `src/colorpicker/ColorPicker.java`
- [RGBA controls](https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java): UI input · `src/colorpicker/ColorPicker.java`
- [Standard color chooser](https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java): Swing dialog · `src/colorpicker/ColorPicker.java`
- [Screen dropper](https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java): UI interaction · Press-and-drag sampling interaction. · `src/colorpicker/ColorPicker.java`
- [Color preview](https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java): UI output · `src/colorpicker/ColorPicker.java`
- [HEX/HSL/HSV/CMYK output](https://github.com/manoharsamvel24/javacolorpicker/blob/main/src/colorpicker/ColorPicker.java): Color conversion · Renders selected color into user-facing formats. · `src/colorpicker/ColorPicker.java`

### Desktop integrations

- **System clipboard**: OS integration
- **Desktop screen capture**: OS integration · Environment-sensitive screen and input access.

### Build and distribution

- [FlatLaf](https://github.com/manoharsamvel24/javacolorpicker/blob/main/lib/flatlaf-3.6.jar): UI runtime library · Provides the modern Swing look and feel. · `lib/flatlaf-3.6.jar`
- [Ant build and manifest](https://github.com/manoharsamvel24/javacolorpicker/blob/main/build.xml): Build packaging · `build.xml`
- [ColorPicker JAR](https://github.com/manoharsamvel24/javacolorpicker/blob/main/dist/ColorPicker.jar): Desktop artifact · Shipped standalone application. · `dist/ColorPicker.jar`
- [Application resources](https://github.com/manoharsamvel24/javacolorpicker/tree/main/src/resources): Resource files · Source resources compiled into the runtime output. · `src/resources`
- [Compiled resources](https://github.com/manoharsamvel24/javacolorpicker/tree/main/build/classes/resources): Build output · `build/classes/resources`

## Connections

- RGBA controls → Selected color state: updates
- Standard color chooser → Selected color state: selects
- Screen dropper → Desktop screen capture: samples
- Desktop screen capture → Selected color state: returns sampled color
- Selected color state → Color preview: renders
- Selected color state → HEX/HSL/HSV/CMYK output: converts
- HEX/HSL/HSV/CMYK output → System clipboard: copies formatted value
- Swing UI and events → RGBA controls: hosts
- Swing UI and events → Standard color chooser: opens
- Swing UI and events → Screen dropper: starts
- FlatLaf → Swing UI and events: styles
- Ant build and manifest → ColorPicker JAR: packages
- FlatLaf → ColorPicker JAR: bundled runtime dependency
- Application resources → Compiled resources: compiled to
- Compiled resources → ColorPicker JAR: packaged in
- ColorPicker JAR → Swing UI and events: launches
