Real-world color picker for identifying colors using the device camera, with HEX, RGB, and HSL color values.
- About the Project
- Key Features
- How it Works
- Getting Started
- Architecture & Technologies
- Changelog
- License
- Donations
ChromaSight is a client-side web application for color measurement. It captures video frames from device cameras, provides an adjustable reticle, and converts sampled pixels to HEX, RGB, and HSL values with matching color names. The application runs offline in the browser without external libraries or network requests.
- Live Camera Sampling: Reads pixel data from camera frames in real time using the Canvas API.
- Sampling Precision: Supports 1-pixel sampling and 5×5 pixel area averaging.
- Movable Reticle: Positions the target point across the viewfinder using tap or drag, with double-tap and button recentering.
- Color Conversion & Naming: Calculates HEX, RGB, and HSL values with closest color name matching using the CIEDE2000 algorithm.
- White Balance Calibration: Provides temperature, tint, and exposure controls, lighting presets, and one-tap neutral surface calibration.
- Freeze Frame: Pauses video streaming to inspect pixels on a static frame.
- Clipboard Copy: Copies HEX, RGB, or HSL values to the clipboard.
- Saved Swatches: Stores copied colors in local storage with a history tray.
- Hardware Controls: Toggles the device flashlight and switches between available cameras.
- Grant camera permission: Allow camera access when prompted by the browser.
- Position the reticle: Tap or drag across the camera view to aim at a surface. Double-tap or press the target button to center it.
- Select sampling mode: Select
Point (1px)for single-pixel readings orSmooth (5px)for area averaging. - Freeze the frame: Press
Freezeto pause the camera and inspect colors on the static image. - Copy color values: Select HEX, RGB, or HSL to copy the value to the clipboard.
- Web Browser: Modern browser with camera support (Chrome, Safari, Firefox, Edge).
- Secure Context: Web browsers require HTTPS or
localhostto access camera hardware. - HTTP Server: Local development server to serve ES modules without CORS restrictions.
-
Clone the repository:
git clone https://github.com/Devilquest/ChromaSight.git
-
Navigate to the project root:
cd ChromaSight -
Launch a local server: Using Python:
python -m http.server 8080
Or using Node.js:
npx serve -l 8080
-
Access the application: Open a browser and navigate to
http://localhost:8080.
| Component | Technology | Purpose |
|---|---|---|
| Markup & Semantics | HTML5 | Accessible HUD structure and modal dialog markup |
| Styling & Motion | Vanilla CSS | Responsive design tokens, viewport units, and micro-interactions |
| Logic & Engine | Vanilla JavaScript (ESM) | Canvas image processing, CIEDE2000 color matching, and hardware control |
| Offline Support | Web App Manifest | Progressive web application metadata and standalone display mode |
.
├── css/
│ └── styles.css Design tokens, responsive layouts, and UI component styling
├── images/
│ └── icon-192.png Application icon asset
├── js/
│ ├── app.js Application initialization, event binding, and frame lifecycle
│ ├── calibration.js White balance color correction, presets, and neutral surface sampling
│ ├── camera.js MediaDevices stream acquisition and hardware capabilities
│ ├── color-engine.js Color space conversions, spatial sampling, and CIEDE2000 matching
│ ├── palette.js Color history management, clipboard operations, and storage
│ └── reticle.js Viewport pointer tracking, targeting constraints, and recentering
├── index.html Single-page application layout and accessible HUD markup
└── manifest.json Progressive Web App configuration and metadata
- Changed:
- Toast wording: Aligns the "palette cleared" toast text with Recent Captures naming.
- Fixed:
- Header layout on small screens: Resolves control collisions and eliminates horizontal scrolling on narrow viewports.
- Added:
- White balance calibration: Manual temperature, tint, and exposure sliders, lighting condition presets, and one-tap neutral surface calibration.
- Unified settings drawer: Consolidated drawer containing sampling precision options, calibration controls, and haptic feedback settings.
- In-app documentation: Modal dialog detailing viewfinder controls, reticle positioning, and sampling precision modes.
- Sampling area frame: Visual 5×5 pixel bounding box highlighting the active averaging window in Smooth mode.
- High-contrast reticle: Fine hairline center mark with a solid 1px outline in Point mode, plus a dual-contrast outer ring for visibility against any background.
- Changed:
- Modular architecture: Codebase reorganization into dedicated modules for camera stream lifecycle, reticle tracking, color space conversion, and calibration.
- Immediate readout refresh: Color readout updates immediately when toggling sampling precision, without requiring reticle movement.
- Integer pixel coordinate snapping: Reticle coordinates snap to integer pixels, preventing antialiasing blur on hairline reticle lines.
- Fixed:
- Camera fallback overlay stacking: Interactive button layer ordering when camera access is denied.
- Camera fallback canvas cleanup: Removal of the fallback canvas element upon granting camera permission.
- Changed:
- Viewport notifications: Relocates floating toast notifications to the viewport bottom to prevent obstructing the camera viewfinder.
- Freeze frame terminology: Replaces color locking wording with camera frame freezing across UI hints, internal documentation, and status feedback.
- Application branding: Harmonizes the title and description to "ChromaSight | Real-World Color Picker" across the web manifest, document metadata, and documentation.
- Added: Initial release.
- Camera viewfinder: Real-time canvas pixel sampling.
- Sampling precision modes: Point (1px) and Smooth (5px) radius modes.
- Reticle: Movable reticle, centered via double-tap or the recenter button.
- Color format conversion: HEX, RGB, and HSL color values.
- Color name matching: Identification using the CIEDE2000 algorithm.
- Freeze and resume: Video frame freeze and live scan controls.
- Clipboard copy: One-tap copy for HEX, RGB, and HSL values.
- Recent Captures: Local tray with clear controls.
- Camera controls: Flashlight toggle and camera facing mode switcher.
This project is licensed under the MIT License.
Copyright © 2026 Devilquest.
Donations are always greatly appreciated. Thank you for your support!
