$ show evilmartians/oklch-picker
This is a production-grade single-page web application for picking and converting colors in the OKLCH and LCH color spaces. It provides interactive 2D charts (WebGL2-accelerated), sliders, numeric inputs, and a 3D gamut model (three.js) to explore and select colors. The app supports sRGB, Display P3, and Rec.2020 gamuts, and can parse and output a wide variety of color formats (hex, rgb, hsl, oklch, lch, lab, linear RGB, Figma P3 hex, etc.). State management is handled by nanostores with persistent settings in localStorage, and the URL hash is used for shareable color states. The codebase is well-structured with clear separation between core color logic (lib/), reactive stores (stores/), and UI components (view/). It includes a comprehensive test suite and CI/CD pipelines for deployment to Firebase Hosting. The architecture is a monolith frontend with no backend, built with Vite, TypeScript, PostCSS, and Pug templates.
The LLM identified 2 files worth highlighting for reuse:
Implements a standalone arithmetic expression parser and evaluator using the shunting-yard algorithm. It handles operator precedence, associativity, whitespace, and trailing operators. The module has zero internal dependencies and can be extracted into any JavaScript/TypeScript project for evaluating simple math expressions like '0.1+0.25*2'. Demonstrates non-obvious skill in implementing a classic algorithm cleanly.
Provides utility functions for detecting keyboard shortcuts with support for non-English keyboard layouts. The `convertKey` function maps physical key codes to logical keys when the browser's `e.key` returns non-ASCII characters, ensuring hotkeys work regardless of keyboard layout. The `isHotkey` function checks if a keyboard event matches a list of hotkey strings (e.g., 'meta+z'). This module is self-contained and reusable for any web application needing robust keyboard shortcut handling.