Giter Site home page Giter Site logo

Rainbow Delimiters Support about slt HOT 8 CLOSED

enerccio avatar enerccio commented on July 17, 2024
Rainbow Delimiters Support

from slt.

Comments (8)

Enerccio avatar Enerccio commented on July 17, 2024 1

Implemented

from slt.

Enerccio avatar Enerccio commented on July 17, 2024 1

I parse the source file, get corresponding parenthesis and get max nesting number. Then I split 1.0 float into same intervals and use that as source to HSV.

from slt.

Enerccio avatar Enerccio commented on July 17, 2024

SLT uses custom highlight to show parenthesis. I wonder if I can cook up some custom solution for this.

from slt.

Enerccio avatar Enerccio commented on July 17, 2024

It looks like this: https://i.imgur.com/6nrrVmt.png

from slt.

olnw avatar olnw commented on July 17, 2024

Great job :) Is it possible to adjust the colours for each depth of parentheses? I think this is important, in order to maintain high enough contrast when using different IDE colour schemes. Also because some people might not like the default colours. (Although I think they're fine.)

For example, rainbow-delimiters for Emacs allows you to customise depths 1-9, with 1 being the outermost colour.

from slt.

Enerccio avatar Enerccio commented on July 17, 2024

Hmm, I suppose I can have a setting for range of colors used. I generate it as HSV 0.0-1.0 so technically there can be other range than 0.0-1.0 so you could set up your own range. Would that be enough?

from slt.

olnw avatar olnw commented on July 17, 2024

I think there is a problem with generating colours in this way, but I could be wrong. The colour difference between each depth of parenthesis will be consistent (which is good), but each parenthesis colour will not necessarily have sufficient contrast with the background colour. Protesilaos Stavrou took this into consideration when choosing the parenthesis colours for his Emacs themes.

Allowing for the user to select a custom range might be helpful, but I think this problem would still remain. Perhaps a better solution is to pre-define colours for some number of depths (say, 10), and to make these colours user-customisable. There could also be an option to limit the number of colours to something less than ten.

I would also like to ask: what number of colours does this implementation use? Do the colours cycle for each level of nesting (eg. red, green, blue, red, green, ...) or will each level have its own unique colour?

BTW I think the current implementation is fine, and is totally an improvement over not having rainbow parentheses. My proposals might be outside the scope of SLT.

from slt.

olnw avatar olnw commented on July 17, 2024

All right, I think your current implementation is fine. Thank you for implementing it so quickly.

from slt.

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.