Giter Club home page Giter Club logo

Comments (8)

onevcat avatar onevcat commented on May 26, 2024 1

Not yet currently. But that is interesting. I will try to see what can be done.

from rainbow.

onevcat avatar onevcat commented on May 26, 2024 1

@dannys42

Naming is so hard.

Obviously it is not rgb, which lies in every aspect so it should be out. ansi might be a good name. Now I am following the wiki page here (https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to give it a bit8 as name (which receives a UInt8, at least it is more or less telling the truth.)

If you like rgb, it should be always easy enough to add an extension. But for now, let me keep it as is until a better name shows up! 😂

from rainbow.

onevcat avatar onevcat commented on May 26, 2024

Per #49 merged, now you can use an 8-bit or 24-bit color (which is limited supported) by using this code:

"hello".bit8(196)
"hello".bit24((255, 0, 0))

from rainbow.

onevcat avatar onevcat commented on May 26, 2024

A new tag will be applied later. Before that, I have some other plans for this library. Before all prepared, if you need this API, feel free to pin it to the master branch for a while. :)

from rainbow.

dannys42 avatar dannys42 commented on May 26, 2024

Woohoo! Thanks!

from rainbow.

onevcat avatar onevcat commented on May 26, 2024

Version 4.0 was just released and containing this change.

from rainbow.

onevcat avatar onevcat commented on May 26, 2024

By the way, even the Hex color is supported and it will be converted to an approximated 8-bit color for you. Check the README for more.

from rainbow.

dannys42 avatar dannys42 commented on May 26, 2024

Thanks! I understand the motivation for calling it "bit", but would "rgb" make more sense? Hmm.. maybe it doesn't make sense for 8-bit.. I only mention because while "rgb" is very common, it's not always the order people use.

from rainbow.

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.