etienne-napoleone / chalk Goto Github PK
View Code? Open in Web Editor NEW๐ A terminal string colorizer for the V language.
License: MIT License
๐ A terminal string colorizer for the V language.
License: MIT License
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'
}
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.