Comments (8)
It may be worth ensuring we have at least one theme that honours the user's terminal colour choices (i.e., a theme which, if they've got light-text-on-dark, so does the theme, and vice-versa); at least one defined in indexed colours (i.e. colours 0-7) which might be redefined by the user* ; and one or more that uses specific colour values (24 bit?) so it looks consistent no matter the terminal settings.
I'm not very experienced with Brick (yet) so I don't know whether it gives us sufficient control. I recently read this blog post -- I Just Wanted Emacs to Look Nice — Using 24-Bit Color in Terminals -- which was a nice summary of how this all works in Today's terminals.
- I'm fairly sure it's only the 4-bit colours and the greyscale ramp that are typically overriden by users who specify custom palettes in terminals. I just tried cycling through the palette options in gnome-terminal whilst watching the output of
256colors2.pl
and only the 0-7 indexed "system colours" and grayscale ramp changed, not the colour cube (=8 bit)
from hledger.
greenterm: shows monochrome green text on black background. Rename to greenonblack ?
Sounds good.
It may be worth ensuring we have at least one theme that honours the user's terminal colour choices (i.e., a theme which, if they've got light-text-on-dark, so does the theme, and vice-versa);
Of the current themes (including dark
), terminal
is the only one that does this. So I think that one should be kept around.
terminal: shows monochrome text using the terminal's current foreground/background colours. Is there a clearer name for this - minimal, transparent, mono.. ?
Perhaps a synonym or reference to the fact it delegates the colour decision to the terminal. I'll ponder on that.
Back to the default theme.
I think it makes sense for the default theme to set a static colour scheme (as it does). Except
But when run in a VS Code terminal, shows me a darkish gray background. Would be nice if it were more consistent, and then it could be renamed to light ?
I can't explain this but I wll try to reproduce it.
For dark
, I think it makes sense for it static too, i.e., always dark, no matter the terminal settings.
from hledger.
terminal
Perhaps a synonym or reference to the fact it delegates the colour decision to the terminal. I'll ponder on that.
"inherit" is the best I've got so far.
from hledger.
default: normally shows me a light background and some colour. But when run in a VS Code terminal, shows me a darkish gray background. Would be nice if it were more consistent, and then it could be renamed to light ?
The colours currently used for themes are taken from the 4-bit palette (indexed colour), which are often different between terminals (and sometimes customised by users). To get consistent colour, a theme would need to swap to colours from a wider palette (Brick seems to support the 8-bit-ish 240-colour mode; we could define some colours using e.g. linearColor; although, a further caveat, we would have to be careful to pick from the 240 supported colours to get consistency; the others are mapped into those.)
This little hack fixes the default theme background colour, for example, even if I switch gnome-terminal
themes or palettes: jmtd@48ddc42
It'll be necessary to test Brick's fallback behavour when operating in a terminal which doesn't support 16-bit colour. (can probably be done in any modern terminal by faking TERM
)
I'll explore this a bit more
from hledger.
The fallback behaviour of Vty when using the 240-color palette with a terminal that does not support it is, sadly, not great; I was expecting (from reading the docs) an approximate mapping into the 4-bit space, but it just writes out in monochrome.
from hledger.
This is the 240 color palette via Vty in my terminal which supports it (kitty)
And here's the same program's output if the TERM is xterm-color (supports 4 bit but not the 8-bit-ish 240 colour palette):
from hledger.
I've pushed a WIP branch that redefines the default theme in terms of the fixed 240 palette. It's early-state, too early for a PR I think, but I'll keep poking at it.
from hledger.
Thanks for your explorations @jmtd!
from hledger.
Related Issues (20)
- roi command includes unwanted amounts when given a period and dates on postings. HOT 6
- `stack8.10.yaml`, build failure `NonEmpty` does not export `singleton` HOT 3
- incorrect prices for "daily" roi HOT 8
- Install instruction under Linux with release 1.34 HOT 1
- tldr clients and documentation HOT 4
- Account type tag inconsistently recognized when declared in multiple files HOT 8
- `check` command should not stop after the first error HOT 4
- `--historical` uses period-end valuations of prices, while `--cumulative` doesn't HOT 15
- Ledger file formatting tool HOT 3
- Importing CSV: Creating complex `*.csv.rules` needs clarity HOT 6
- Code for Postings HOT 3
- ledger import not assigning default account2 as per manual HOT 3
- aregister -P, -C and -U miscalculate initial balance HOT 5
- UI bug in hledger web - autocomplete not working on the 5th account field and beyond HOT 5
- NBSP parsing seems to be broken (at least in CSV) HOT 1
- "every Nth day" periodic rule violating start date HOT 6
- Unnecessary <th></th> before the "Average" column in the HTML output of the incomestatement HOT 6
- hledger-web register does not show From/To accounts HOT 2
- Allow check recentassertions to respect --unmarked, --pending, --cleared HOT 5
- Providing the command argument from a config file does not work HOT 1
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 hledger.