A work-in-progress extension for the Zed editor that aims to provide inline color previews for color values in supported file types.
- Inline color previews next to color values in:
- CSS/SCSS files
- HTML files
- JavaScript/TypeScript files
- Any other file types that contain color values
- Support for various color formats:
- Hex colors (e.g.,
#ff0000
,#f00
) - RGB/RGBA (e.g.,
rgb(255, 0, 0)
,rgba(255, 0, 0, 0.5)
) - HSL/HSLA (e.g.,
hsl(0, 100%, 50%)
,hsla(0, 100%, 50%, 0.5)
) - Named colors (e.g.,
red
,blue
,transparent
)
- Hex colors (e.g.,
This extension is currently in a pre-alpha state. While the basic structure is in place, it cannot yet provide inline color previews because the necessary APIs are not yet available in the Zed extension API.
- Basic extension structure and registration
- Color detection logic (not currently used)
- LSP completion handling for color values (when provided by language servers)
The following features require APIs that are not yet available in the Zed extension API:
- Access to editor buffer content
- Ability to add inline decorations/previews
- Buffer change event registration
- Color preview rendering
This extension is waiting for the following APIs to be added to the Zed extension API:
- Buffer access and manipulation
- Inline decoration support
- Buffer change event system
Once these APIs are available, the extension will be updated to provide the planned functionality.
If you're interested in helping with this extension:
- Watch the Zed GitHub repository for updates to the extension API
- Consider contributing to Zed by implementing the necessary APIs for buffer decorations
- Help improve the color detection logic in the meantime
This project is open source and available under the MIT License.