Skip to content

About

Color picker for identifying colors using the device camera, with HEX, RGB, and HSL color values.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChromaSight Logo

ChromaSight

Real-world color picker for identifying colors using the device camera, with HEX, RGB, and HSL color values.

Version License: MIT Live Site

Open ChromaSight


Table of Contents


About the Project

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.


Key Features

  • 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.

How it Works

  1. Grant camera permission: Allow camera access when prompted by the browser.
  2. 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.
  3. Select sampling mode: Select Point (1px) for single-pixel readings or Smooth (5px) for area averaging.
  4. Freeze the frame: Press Freeze to pause the camera and inspect colors on the static image.
  5. Copy color values: Select HEX, RGB, or HSL to copy the value to the clipboard.

Getting Started

Prerequisites

  • Web Browser: Modern browser with camera support (Chrome, Safari, Firefox, Edge).
  • Secure Context: Web browsers require HTTPS or localhost to access camera hardware.
  • HTTP Server: Local development server to serve ES modules without CORS restrictions.

Installation

  1. Clone the repository:

    git clone https://github.com/Devilquest/ChromaSight.git
  2. Navigate to the project root:

    cd ChromaSight
  3. Launch a local server: Using Python:

    python -m http.server 8080

    Or using Node.js:

    npx serve -l 8080
  4. Access the application: Open a browser and navigate to http://localhost:8080.


Architecture & Technologies

Tech Stack

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

Project Structure

.
├── 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

Changelog

[1.1.1]

  • 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.

[1.1.0]

  • 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.

[1.0.1]

  • 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.

[1.0.0]

  • 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.

License

This project is licensed under the MIT License.

Copyright © 2026 Devilquest.


Donations

Donations are always greatly appreciated. Thank you for your support!

Buy Me A Dinosaur

About

Color picker for identifying colors using the device camera, with HEX, RGB, and HSL color values.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages