-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(v3) Suggestion - Build-time color calculations #86
Comments
Thanks for opening this issue. Original discussion, for reference: #85. |
I'm thinking about this more as I've decided to translate Ayu over to colortemplate... I'm not so confident about this suggestion anymore due to the number of challenges it creates. A significant number of colors in Ayu are defined in terms of other colors using
I'm still left wondering whether there is an opportunity to permit alpha values in the template such that final values are calculated at compile time. Practically, this would require the background color of one highlight to be simulated against the background color of another highlight... I haven't made much progress yet, but I anticipate This isn't to say Edit: Or perhaps some convenience Colortemplate command/color picker feature can manage it. |
I'm more for orthogonality of features, so I second this. What you propose seems like a plugin in itself. Colortemplate has a color/style picker ( Btw, what's the role of alpha channels here? I don't think Vim supports transparent colors. |
Alpha compositing can create the illusion of a color with transparency. In this example, the overlays are the same color ( background: Using a made-up syntax, this could be something like:
In the case of Ayu with "light," "dark," and "mirage" variations, pre-calculating lighten/darken (in the Lab color space) and alpha composition (in the sRGB color space) gets a bit tedious. It's not a huge deal. |
This example has me thinking about the concept of "color namespaces" as well... perhaps a
I could make a separate issue if this is something you find appealing. |
This would be a method for calculating relative colors at build time, e.g. a color with an "alpha layer" simulated atop a solid base color. I've seen color palettes (like ayu) generated using tools like https://gka.github.io/chroma.js/ (with lighten, darken, etc.). It would be nice to expose a high-level, build-time interface for manipulating colors. I'm not sure whether this would be used within the
Color:
directive or in some new way... perhapsRelativeColor:
, but that may be redundant if some function-like interface is required, e.g.mix(#ABCDEFFF, #CECECEAA)
(this seems like a poor example... there would need to be a way to reference other colors at a minimum).Referencing libcolor here as well.
The text was updated successfully, but these errors were encountered: