Coder Social home page Coder Social logo

Comments (8)

riskygit avatar riskygit commented on June 15, 2024 1

Okay, now I understand—thanks for bearing with me. I think the "opt in at your own peril" solution is great. I was unaware of that property of some terminals limited to ANSI colors.

from vim-colortemplate.

riskygit avatar riskygit commented on June 15, 2024

I left my desk, but I imagine I just failed to test excluding the 256 variant altogether when both 16 and 256 variants are the same…

from vim-colortemplate.

riskygit avatar riskygit commented on June 15, 2024

Just tested: my assumption was incorrect. The syntax seems to require a 256 value first and that must be in the range [16, 255].

Some examples of rejected entries:

Color: myblue #abcdef Blue
Color: myblue #abcdef 4
Color: myblue #abcdef Blue Blue
Color: myblue #abcdef 4 4

Edit: It may have to do with the integer requirement in combination with the libcolor function checks; probably need to check which function to use (if it's in [0, 15] use the cterm function otherwise the xterm function)...

from vim-colortemplate.

lifepillar avatar lifepillar commented on June 15, 2024

That's by design. A color scheme that has a color in 0–15 will produce unpredictable results unless the terminal colors are set to predefined values (which is a requirement for Base16). This severely restricts the scope for using your color scheme to terminals with some specific settings.

Mixing the terminal-dependent range 0–15 with the more predictable (though not uniquely defined) 16–255 range of colors makes your color scheme even less usable. AFAIK, Base16 requires the user to run a script to change the terminal palette—colors 16–21 in particular—which works only in some terminals.

Colortemplate v3 was designed having in mind color schemes that are proposed for inclusion in Vim, so some bad choices such as those above have been forbidden. It wouldn't be too difficult to add an option to lift such restriction, though.

from vim-colortemplate.

lifepillar avatar lifepillar commented on June 15, 2024

The syntax seems to require a 256 value first and that must be in the range [16, 255].

A color definition has three values:

  • a hex value, used for GUI and true-color terminals;
  • a “base-256” (or xterm) value, that is, a value in the range 16–255 or a color name in v:colornames. This is used for terminals with 256 colors. As the Xterm palette is similar, though not identical, across terminals, this gives the most predictable results for terminal not supporting true colors. That wouldn't be the case if colors 0–15 were allowed, too.
  • a “base-16” or ANSI value, that is, a value in the range 0–15 or a color name among those listed in :help ctermc-colors. This range entirely depends on the terminal settings, and is used when t_Co is set to a value less than 256.

from vim-colortemplate.

riskygit avatar riskygit commented on June 15, 2024

Aren't the ANSI colors a subset of the xterm colors? I would imagine you could use "Black," for example, in a palette using xterm colors.

from vim-colortemplate.

lifepillar avatar lifepillar commented on June 15, 2024

Sure you can. The (opinionated, if you want) stance of Colortemplate is that you shouldn't, because that Black might be white or pink.

But there is no technical reason to prevent that. I will add an option to relax the restriction.

from vim-colortemplate.

lifepillar avatar lifepillar commented on June 15, 2024

The current head of the v3 branch should allow you to use any value between 0 and 255. Feel free to reopen if that does not work as expected.

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.