Comments (1)
Hue doesn't color the strings with magic, it uses ANSI escape sequences to do that.
The characters of ANSI escape sequences are the reason behind the increased length.
Hue is meant to print strings, if you want measure the length of string for some programmatical operation, do it before supplying it hue.
Another solution would be to subtract the length of ANSI sequence from the returned length.
from huepy.
Related Issues (19)
- duplicate functions HOT 1
- Suggestion to create a pypi package for this HOT 12
- Change the project license to something suitable for software HOT 1
- Ability to add new labels, colors, styles HOT 4
- Windows support HOT 2
- make it cross platform HOT 2
- Write the difference with competitors in the README HOT 3
- 0.9.8 is broken HOT 4
- Hue vs Huepy
- embedded colored strings unset outer colored string HOT 5
- use unichars instead of ! x and etc HOT 3
- Python2 crashes with non-ascii characters. HOT 1
- Syntax error on clean install HOT 1
- Port hue to Python3 HOT 1
- huepy 1.1 fails pip installation HOT 1
- Light colors and styles not doing anything
- run() has no contrast on light theme
- three dots HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from huepy.