Git Product home page Git Product logo

Comments (3)

lifepillar avatar lifepillar commented on May 22, 2024

You are talking about :ColortemplateStyle, right?

I see two problems with your request: first, there are many ways to transition from one color to another, so you would need to define what a “transition path” means. Second, there are different possible design choices for such a feature in the style dialog: off the top of my head:

  • let the user clip the bounds of the color bars in the RGB and HSB panes according to some source and target color.
  • Add a new pane specifically for color transitions.
  • Connect the bars, say in the HSB space, so that when you change one, the others move automatically based on some target color (?).

Getting any of these right (also in the sense of usability) is non-trivial and would need some research (I am not a color expert either!). It would also increase the complexity of the style dialog, so one should evaluate whether the benefit the feature brings is worth it.

For your specific, example, I would use the style dialog as follows. First, take a look at the HSB values for Normal's background color:
solarized8-normal-bg
Now, switch to the foreground (Shift-Tab):
solarized8-normal-fg
So, to transition from fg to bg in this color space you essentially need to increase the saturation and decrease the brightness (hue is almost the same). You can do that by hand, with some trial and error. Not ideal, but not too difficult either. But this is probably what you are doing now anyway, so I know that this is not a very helpful suggestion.

An alternative is to use a real color editor, one of the many you may find on the web or the one provided by your OS. If you find the functionality you want implemented somewhere, I may take a look and try to port the feature to Colortemplate. Having a reference specification would be of great help.

from vim-colortemplate.

dhduvall avatar dhduvall commented on May 22, 2024

Well, this got more complicated than I thought, and pretty quickly. 😃 Here are some not-too-deep thoughts.

I guess there are two decisions in this: what does "transition" mean here, and what would the UI look like?

I poked around regarding color gradients, and thought that https://raphlinus.github.io/color/2021/01/18/oklab-critique.html was a pretty good writeup (and the tool was useful, too). Plugging in the foreground and background Solarized colors gets me the gradient I want, though these colors don't elicit much distinction between the colorspaces. There's a lot written about transitioning between two colors, and it's too much (for me) to take it all in. But it looks to me like the idea would be to choose a colorspace definition and do a linear transition in that context, much like the gradients in the tool.

As for the UI for the hypothetical colortemplate feature ... I don't have anything to point you at. I think what I'm envisioning is your second option. In that pane, you have a single slider (position along the gradient) and a preview of the entire gradient (quantized as best you can in a text UI). You'd need some way of choosing the colorspace (having multiple on-screen simultaneously like in that blog entry is probably too overwhelming) if the plugin doesn't make the choice for you (and the implementer has the time and energy to implement more than one). And some way of choosing the endpoints. For my use-case, that could simply be using the fg/bg of the current cell so you wouldn't need any extra UI. But maybe someone can think of other use-cases that would require a chooser.

Using the current fg/bg seems a bit slippery—as those values change, in this pane or any other, then do the endpoints change? That seems pretty bad. It could stay fixed at the fg/bg when the dialog came up.

I don't know how compatible the code on that page is with the code you've written or how the licensing would work (it's Apache 2.0), but I hope it would reduce the implementation effort, should you (or I, but probably not) choose to do it.

from vim-colortemplate.

lifepillar avatar lifepillar commented on May 22, 2024

Thanks for the link, that's very helpful! Yeah, something like that would have to be done in a new pane.

from vim-colortemplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.