GithubHelp home page GithubHelp logo

Comments (5)

gaborcsardi avatar gaborcsardi commented on June 12, 2024

Essentially embedding works for the same type of styles, e.g. foreground colors are a type of style. Different style types are orthogonal. E.g.

green("hello ", bold("there"), "yo")
#> [1] "\033[32mhello  \033[1mthere\033[22m yo\033[39m"

is all green, but in the middle also bold. The boldness does not turn off the greenness.

reset is a special style that does not play well with any other styles in terms of embedding.

I guess we could have a resetColor and a resetBgColor style, and this would reset only the fg and bg colors and these would work well with embedding.

from crayon.

brodieG avatar brodieG commented on June 12, 2024

If I get around to it I'll mock up the example I'm thinking of. Embedding for the same type of styles does not work in plain ANSI. You awesomely got it to work for crayon by moving existing closing escape sequences. I think we can do the same for reset so long as we're willing to throw in every possible type of closing sequence. Either way, it's on me to mock it up and I think it's going to be kinda far down the priority list. Feel free to close the issue if having an open issue is annoying to you since I'm unlikely to get to this anytime soon.

from crayon.

gaborcsardi avatar gaborcsardi commented on June 12, 2024

OK. I might implement resetColor and resetBgColor in the meanwhile, I think those still make sense.

from crayon.

gaborcsardi avatar gaborcsardi commented on June 12, 2024

I am going to close this now, please reopen if you want to work on it.

from crayon.

brodieG avatar brodieG commented on June 12, 2024

Sounds good.

from crayon.

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.