Giter Club home page Giter Club logo

chalk's People

Contributors

etienne-napoleone avatar serkonda7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

chalk's Issues

Feature request: hex color

I was about to create my own chalk module that allowed hex, but then I saw this. It would only require a bit more work I think to expand this:

This is the syntax for rgb value:

//bg
println('\e[48;2;$r;$g;${b}mhello world\e[0m')
//fg
println('\e[38;2;$r;$g;${b}mhello world\e[0m')

converting hex (#ffffff) to rgb

import strconv

fn rgb_from_hex (s string) string {
    r := strconv.common_parse_int(s[1..3], 16, 16, true, false) or { 0 }
    g := strconv.common_parse_int(s[3..5], 16, 16, true, false) or { 0 }
    b := strconv.common_parse_int(s[5..7], 16, 16, true, false) or { 0 }
    return '$r;$g;$b'
}

could not get the example to work as expected

Hi. Just wanted to try vlang, and of course I needed colors for my terminal :)

I tried to install as described in readme, which works fine. The code is downloaded to ~/.vmodules/etienne-napoleone

So i guess a working example should be

import etienne-napoleone.chalk
...

But this gives me the following warning:

cannot import module "etienne" (not found)

So, the "dash" in your username is probably not compatible with the way V imports libraries.
When I rename this folder to "etiennenapoleone", it works fine.

Thank you.

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.