How manoharsamvel24/javacolorpicker works
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: ColorPicker.java Swing UI and events · ColorPicker.jar ColorPicker JAR · flatlaf-3.6.jar FlatLaf · resources Compiled resources
Components 14
Desktop application
- Swing UI and events · Primary interface, event handling, and color processing.
src/colorpicker/ColorPicker.java - Selected color state · Mutable RGBA selection shared by all acquisition paths.
src/colorpicker/ColorPicker.java - RGBA controls
src/colorpicker/ColorPicker.java - Standard color chooser
src/colorpicker/ColorPicker.java - Screen dropper · Press-and-drag sampling interaction.
src/colorpicker/ColorPicker.java - Color preview
src/colorpicker/ColorPicker.java - HEX/HSL/HSV/CMYK output · Renders selected color into user-facing formats.
src/colorpicker/ColorPicker.java
Desktop integrations
- System clipboard
- Desktop screen capture · Environment-sensitive screen and input access.
Build and distribution
- FlatLaf · Provides the modern Swing look and feel.
lib/flatlaf-3.6.jar - Ant build and manifest
build.xml - ColorPicker JAR · Shipped standalone application.
dist/ColorPicker.jar - Application resources · Source resources compiled into the runtime output.
src/resources - Compiled resources
build/classes/resources
Connections 16
- 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