Alec Thomas
bbc59ac372
Emit error tokens when there's a group mismatch.
...
Also don't panic/recover, as we no longer use panic to report "real"
errors.
Fixes #295 .
2019-10-24 17:03:35 +11:00
Alec Thomas
73d11b3c45
Clear background colour for TTY formatters.
2019-10-15 21:08:17 +11:00
Ray Lee
2f5349aa18
Add italics support for indexed colour terminals
2019-09-02 08:12:43 +10:00
Daniel Eloff
9c3abeae1d
Tokens by value ( #187 )
...
This results in about a 8% improvement in speed.
2018-11-04 10:22:51 +11:00
Alec Thomas
bc2d6680e4
Run gofmt -s over the codebase.
2017-09-26 22:05:55 +10:00
Alec Thomas
d5083b3f7c
Big changes to the style and colour APIs.
...
- Styles now use a builder system, to enforce immutability of styles.
- Corrected and cleaned up how style inheritance works.
- Added a brightening function to colours
- HTML formatter will now automatically pick line and highlight colours
if they are not provided in the style. This is done by slightly
darkening or lightening.
Fixes #21 .
2017-09-23 22:09:46 +10:00
Alec Thomas
8170d52c25
Remove dependency on go-colorful.
...
Switched to a less accurate (but much simpler) colour distance function
as described here: https://www.compuphase.com/cmetric.htm
Fixes #17 .
2017-09-22 23:00:03 +10:00
Alec Thomas
551f7cee9a
Return errors for invalid styles, rather than panicking.
2017-09-21 12:52:08 +10:00
Alec Thomas
e2d6abaa64
Document and add iterator panic recovery.
2017-09-20 23:06:23 +10:00
Alec Thomas
cc0e4a59ab
Switch to an Iterator interface.
...
This is to solve an issue where writers returned by the Formatter
were often stateful, but this fact was not obvious to the API consumer,
and failed in interesting ways.
2017-09-20 22:19:36 +10:00
Alec Thomas
431e913333
Update documentation. Include "quick" package.
2017-09-18 13:15:07 +10:00
Alec Thomas
d12529ae61
HTML formatter + import all Pygments styles.
2017-07-20 00:01:29 -07:00
Alec Thomas
7b6a07b9bb
Revert to using CIE76 for style colour matching.
...
Some testing showed RGB distance was *really* bad.
2017-06-07 19:47:59 +10:00
Alec Thomas
d852022f8d
Move style and formatter API into chroma package.
2017-06-07 19:47:59 +10:00
Alec Thomas
ef4a53333b
Just use a basic RGB distance.
...
Not perfect, but probably sufficient.
2017-06-07 19:47:59 +10:00
Alec Thomas
5749aebe42
Generalise and support 8, 256 and 16m colour terminals.
2017-06-07 19:47:59 +10:00