🌊 Color FlowVisualize CSS colors in HTML documents with intelligent , configurable highlighting 📺 Demo - Inline Styles
📺 Demo - CSS Classes
✨ FeaturesColor Flow enhances your HTML development experience by automatically detecting and visualizing inline CSS colors with beautiful, configurable background highlights.
📦 Extension Info
🚀 InstallationVia VS Code Marketplace (Recommended)
Via Command Palette
From VSIX File
📖 UsageOnce installed, Color Flow automatically highlights colors in documents with inline styles: Basic Example
Status Bar ControlLook for the Color Flow icon in the bottom-left status bar:
Click the status bar item to quickly access Color Flow settings. Keyboard Commands
⚙️ ConfigurationColor Flow provides extensive configuration options to customize your highlighting experience. Quick Configuration
Detailed Settings
|
| Format | Examples |
|---|---|
| Named Colors | red, blue, green, tomato, slateblue |
| Hex Colors | #f00, #ff0000, #ff0000ff, #FFF |
| RGB/RGBA | rgb(255,0,0), rgba(255,0,0,0.5), rgb(100%, 0%, 0%) |
| HSL/HSLA | hsl(0,100%,50%), hsla(0,100%,50%,0.5) |
🌐 Supported Languages
Color Flow works seamlessly with the following file types and languages:
- 📄 HTML - Standard HTML files (
.html,.htm) - 🐘 PHP - PHP files with HTML content (
.php) - 💚 Vue - Vue Single File Components (
.vue) - 🔥 Svelte - Svelte components (
.svelte) - 🌟 Astro - Astro components (
.astro) - ⚛️ TypeScript React - TSX files (
.tsx) - ⚛️ JavaScript React - JSX files (
.jsx) - 🔵 Razor - Blazor files (
.razor) - 📝 Handlebars - Handlebars templates (
.hbs) - 🔧 EJS - Embedded JavaScript templates (
.ejs)
🔍 How It Works
Color Flow uses a sophisticated parsing pipeline to deliver accurate and performant color visualization:
graph LR
A[Document Change] --> B[Parse HTML]
B --> C[Extract Inline Styles]
C --> D[Parse Style Tags]
D --> E[Identify Color Properties]
E --> F[Convert to RGBA]
F --> G[Apply Opacity]
G --> H[Calculate Ranges]
H --> I[Render Decorations]
Technical Details
- Document Parsing - Uses
htmlparser2for fast, accurate HTML parsing - Style Extraction - Identifies elements with inline
styleattributes - CSS Parsing - Extracts CSS rules from
<style>tags and linked external CSS files - CSS Variables - Parses custom properties and resolves
var(--name)references with fallback support - Color Detection - Extracts
color,background-color, andbackgroundColorproperties - Color Conversion - Converts all formats to RGBA with configured opacity using
tinycolor2 - Range Calculation - Determines precise text ranges based on selected highlight mode
- Decoration Application - Applies VS Code text decorations with real-time updates
⚠️ Limitations
Color Flow is designed for inline styles and class-based colors and currently supports:
✅ Supported:
- Inline styles (
style="..."attributes) - CSS class definitions (
.class { color: red; }) within<style>tags and linked CSS files - CSS custom properties (variables) like
var(--my-color)with fallback support - Direct color values (named, hex, rgb, hsl)
- Color inheritance from parent elements (nested elements inherit colors from ancestors)
- Real-time updates during editing
❌ Not Supported:
- Computed styles from JavaScript
- Dynamic color values from CSS expressions
- CSS variables defined in browser developer tools
🛠️ Development
Prerequisites
- Node.js 18+
- Visual Studio Code 1.74.0+
- TypeScript 5.0+
Setup
- Clone the repository
git clone https://github.com/DotJumpDot/Color-Flow.git
cd Color-Flow
- Install dependencies
npm install
- Compile TypeScript
npm run compile
- Run tests
npm test
- Launch in Debug Mode
Open the project in VS Code and press F5 to launch the extension in a new VS Code window with the extension loaded.
Project Structure
color-flow/
├── src/
│ ├── colorConverter.ts # Color parsing and conversion
│ ├── styleParser.ts # CSS style string parsing
│ ├── htmlParser.ts # HTML document parsing
│ ├── cssParser.ts # CSS class color extraction
│ ├── settingsManager.ts # Extension configuration
│ ├── decorationManager.ts # VS Code decoration handling
│ └── extension.ts # Main entry point
├── assets/ # Images and demo files
├── test/ # Test files
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
└── README.md # This file
Build Commands
| Command | Description |
|---|---|
npm run compile |
Compile TypeScript to JavaScript |
npm run watch |
Watch for changes and compile |
npm run pretest |
Compile before tests |
npm test |
Run test suite |
npm run lint |
Run ESLint |
npm run package |
Package extension into .vsix |
🤝 Contributing
Contributions are welcome and appreciated! Here's how you can help:
Reporting Bugs
Before creating bug reports, please check existing issues to avoid duplicates. When reporting a bug, include:
- OS and VS Code version
- Extension version
- Steps to reproduce
- Expected vs actual behavior
- Screenshots if applicable
Suggesting Features
Feature requests are welcome! Please describe:
- The use case
- Proposed implementation (if you have ideas)
- How it would benefit users
Submitting Pull Requests
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure your code:
- Follows existing code style
- Includes tests for new functionality
- Updates documentation as needed
- Passes all linting checks
📊 Performance
Color Flow is optimized for minimal performance impact:
- ⚡ Fast Parsing - Uses
htmlparser2for efficient HTML parsing - 🎯 Debounced Updates - 100ms delay prevents excessive decorations during typing
- 💾 Decoration Caching - Reuses VS Code decoration types for better performance
- 🔍 Selective Processing - Only processes supported file types
🗺️ Roadmap
Future enhancements planned:
- [ ] Color picker integration
- [ ] Custom color themes
- [ ] Export color palette
- [ ] Support for computed styles
- [ ] Color contrast checker
- [ ] Additional highlight modes
- [ ] CSS @import support (importing external CSS from within CSS files)
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2026 DotJumpDot
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
🙏 Credits
Built with amazing open-source libraries:
- htmlparser2 - Fast and forgiving HTML/XML parser
- tinycolor2 - Color manipulation and conversion library
- vscode - Visual Studio Code Extension API
📚 Resources
| Resource | Link |
|---|---|
| VS Marketplace | Color Flow |
| GitHub Issues | Report Issues |
| API Documentation | AGENTS.md |
| Changelog | CHANGELOG.md |
| Releases | GitHub Releases |
💬 Support
- 📖 Documentation: Check out our API documentation
- 🐛 Bug Reports: Open an issue on GitHub
- 💡 Feature Requests: Share your ideas in our discussions
- ⭐ Star Us: If you find Color Flow useful, give us a star on GitHub!
Made with ❤️ by DotJumpDot

