Skip to content

azsoftstudio/colorforge

Repository files navigation

🎨 ColorForge

Explore, harmonize, and export colors with mathematical precision β€” fully offline and security-hardened. The ultimate color system design tool for UI designers, frontend developers, and power users.

License: MIT Version React Electron Vite


ColorForge Hero


Quick Start β€’ Features β€’ Workflows β€’ Technical β€’ Math & Precision

⏱️ TL;DR (30 seconds)

  1. Open ColorForge.
  2. Pick a base color using the wheel (or image picker).
  3. Use Harmony Palette to generate matching colors.
  4. Check readability in Accessibility Rating.
  5. Copy values from Color Values (HEX/RGB/HSL/CMYK/LAB/LCH).
  6. Reuse colors from History.

That's the core workflow. βœ…


πŸ‘₯ Who is this for?

  • Designers: Who want fast visual harmony + accessibility confidence.
  • Developers: Who need accurate color values and conversion formats.
  • Power Users / Modders: Who want to understand internals and rebuild/extend the app.

πŸ› οΈ Main Features

1) Color Picking

  • Interactive Hue Ring + Saturation/Value square for precise selection.
  • Optional Image / Eyedropper picker flow for sampling from external sources.

2) Harmony Generation

Generate balanced palettes including:

  • Monochromatic, Complementary, Triadic, Analogous, Split Complementary, Tetradic.
  • Lock Palette: Keep your base color stable while exploring variants.
  • Enforce WCAG: Push harmony choices toward better contrast automatically.

3) Accessibility Checker

Real-time contrast previews for white and black text on your selected color.

  • AAA / AA / AA Large / Fail ratings based on WCAG 2.1.

4) Professional Export Formats

Copy directly as: HEX, RGB, HSL, CMYK, LAB, LCH.

5) Usability Features

  • Undo / Redo (UI buttons + Ctrl+Z / Ctrl+Y).
  • Randomize color for quick inspiration.
  • Persistent color history stored locally.
  • Theme support (Dark/Light) and resizable sidebar.

🏁 Quick Start

A. Pick Your Color

  • Drag around the Hue Wheel.
  • Drag inside the SV Square to tune saturation and brightness.

B. Build Palette

  • Go to the Harmony Palette section.
  • Switch tabs until it "feels right."
  • Click swatches to set them as the active color.

C. Verify Contrast

  • Look at the Accessibility Rating cards.
  • Prefer AA or AAA for normal text.

D. Copy Value

  • In Color Values, click the copy icon next to your needed format.

🎨 Designer Workflows

Workflow 1: Brand Accent Exploration

  1. Start with your brand seed color.
  2. Open Triadic and Analogous tabs.
  3. Lock palette to compare options.
  4. Keep one vibrant accent + one support tone.
  5. Check contrast before finalizing.

Workflow 2: UI Theme Building

  1. Pick your primary hue.
  2. Use Monochromatic for depth (cards, hover states, borders).
  3. Use Complementary/Split for call-to-action accents.
  4. Check black/white text grades for each critical background.
  5. Export HEX + HSL for design/dev handoff.

Workflow 3: Accessibility-first Palette

  1. Enable Enforce WCAG.
  2. Iterate until major UI surfaces pass AA or AAA.
  3. Validate manually for key text sizes and weights.
  4. Export implementation-ready values.

⌨️ Controls & Shortcuts

Action Shortcut
Undo Ctrl+Z (or Cmd+Z)
Redo Ctrl+Y (or Ctrl+Shift+Z)

πŸ“ Color Value Notes

Format Best For
HEX Quick dev/design handoff. Usually the default.
RGB Canvas, dynamic UI rendering logic.
HSL Thematic tuning (same hue, different lightness).
CMYK Print-adjacent workflows (approximation).
LAB / LCH Perceptual handling for harmony logic and visual balance.

βš™οΈ Technical Overview

Stack

  • React 19: Modern UI library.
  • Vite: Ultra-fast build tool.
  • Electron: Cross-platform desktop runtime.
  • Vanilla CSS: Performance-first styling.

State Model (HSV)

Canonical color state is maintained in HSV (Hue, Saturation, Value).

  • Why? It maps naturally to wheel + SV square interactions, keeping UI logic predictable.
  • All other spaces (RGB, HEX, CMYK, HSL, LAB, LCH) are derived values.

Harmony Engine

  • LCH-based generation for perceptual consistency.
  • Constrains lightness/chroma ranges to avoid unusable extremes.
  • Optional contrast nudging for dark/light theme context.

Security Defaults

ColorForge operates with restricted privileges:

  • nodeIntegration: false, contextIsolation: true, sandbox: true.

βš–οΈ Math Precision & Validation

This section outlines the mathematical foundation and precision characteristics of the ColorForge engine.

Standards Compliance

  • sRGB: Implements IEC 61966-2-1 with correct linear/gamma transforms.
  • Illuminant: Uses D65 as the reference white point.
  • LAB/LCH: Follows the CIE 1976 LAB specification.
  • Contrast: Implements WCAG 2.1 Relative Luminance formula exactly.

Precision & Quantization

  1. Integer LAB Storage: LAB/LCH components are stored as integers (L: 0–100, a/b: -128 to 127). This introduces a Β±0.5 unit error in LAB, which can amplify to Β±10 units in RGB for highly saturated colors.
  2. Gamma Correction: Uses the full sRGB companding curve instead of a simple 2.2 power law to avoid errors in dark tones.

Validation Results (Passing 56/56)

Section Tests Status Notes
HEX ↔ RGB 9 βœ… Pass Exact mapping, no rounding loss.
RGB ↔ HSV 10 βœ… Pass Round-trip Ξ” ≀ 1.
RGB ↔ HSL 10 βœ… Pass Verified against CSS spec.
RGB ↔ CMYK 8 βœ… Pass Handles K=100 edge case.
RGB β†’ LAB 5 βœ… Pass Matches D65 sRGB references.
LAB ↔ RGB 4 βœ… Pass Verified within quantization limits.
RGB β†’ LCH 2 βœ… Pass Verified polar mapping.
WCAG Contrast 4 βœ… Pass Exact to 4 decimal places.
Edge Cases 4 βœ… Pass Invalid HEX returns null; no NaNs.

πŸ†˜ Common Issues

  • "Eyedropper not available": Some environments lack the native EyeDropper API. Use image upload + click sampling fallback.
  • "My pasted format did not update color": Input parser expects full format (e.g., hsl(180, 50%, 50%)).
  • "Why did harmony swatches change slightly?": Engine may apply small variations for natural-looking exploration.
  • "Copied value failed": Clipboard permissions can fail in restricted environments; retry in desktop context.

πŸ›‘οΈ Data, Privacy & Security

  • Local-first: No account, no cloud, no tracking.
  • Offline: Core features require zero internet connection.
  • Restricted: Desktop runtime uses restricted renderer privileges.

Layer Status Technical Detail
Offline Mode 100% No external network requests; zero tracking or telemetry.
Execution Sandboxed Renderer process is strictly isolated from the operating system.
Node Integration Disabled Prevents arbitrary filesystem or shell access from the UI.
Context Isolation Active Separates renderer logic from internal app APIs via a secure IPC bridge.
CSP Strict Blocks unauthorized scripts and all non-system external assets.

Important

Windows Security Notice: As ColorForge is an open-source, community-driven tool, Windows may flag the installer as "unsigned." This is expected. The source code is fully transparent and available here for audit. To install, click More info β†’ Run anyway.


πŸ’‘ Extension Ideas

  • Strict deterministic harmony mode (remove randomness).
  • Improved parser validation (decimals, stricter HEX).
  • Expanded accessibility simulation (text sizes/weights).
  • Palette export presets (JSON/Tailwind/CSS variables).

πŸ“– Glossary

  • HSV: Hue, Saturation, Value (interaction-friendly).
  • HSL: Hue, Saturation, Lightness (styling-friendly).
  • LAB / LCH: Perceptual spaces for visually consistent operations.
  • Contrast Ratio: Readability metric between text and background.
  • WCAG: Web Content Accessibility Guidelines.

🏁 Getting Started

Prerequisites

  • Node.js (Latest LTS)
  • Windows 10/11 (Recommended for native EyeDropper support)

Setup & Development

# Clone the repository
git clone https://github.com/azsoftstudio/colorforge.git

# Install dependencies
npm install

# Launch development environment (Vite + Electron)
npm run dev

Production Build

# Generate a standalone Windows installer (.exe)
npm run make-exe

πŸ“– Additional Resources

Looking for more depth? Master the LCH workflow with our Official Documentation:

  • Mini-tutorials on accessible palette design.
  • Technical deep-dives into LCH Color Theory.
  • Developer API references for internal utilities.

❀️ Contributions & Support

Developed with ❀️ by AZSoftStudio. Licensed under MIT β€” we welcome community contributions and feedback!

ColorForge β€’ Professional Color Engineering

About

Premium color design tool with LCH-based harmonies, WCAG accessibility checks, and persistent history.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors