1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-03-19 21:10:15 +02:00

11 Commits

Author SHA1 Message Date
Alec Thomas
c263f6fa19
feat: XML style definitions (#693)
Fixes #635.
2022-11-01 21:23:14 -07:00
Alec Thomas
40b7a9135a Upgrade project to Go 1.19 and switch to alecthomas/assert/v2 2022-10-18 08:55:38 +11:00
Daniel Erat
dbb09a52a8 Add Colour.ClampBrightness and StyleBuilder.Transform.
These functions can make it easier to to update a style's
contrast when viewed against light and dark backgrounds.
See #353.

Also avoid a segfault when Get is called on a StyleBuilder
that was created using NewStyleBuilder (as opposed to
Style.Builder).
2022-08-31 22:20:56 +10:00
Alec Thomas
54fd3bc12f Clean up imports and make cmd/chroma its own module. 2021-06-18 16:56:50 +10:00
Zhangyuan Nie
d67a2bfdc2
fix: synthesisable entries are ignored when cloned (#465) 2021-04-11 15:06:10 +10:00
Alec Thomas
2a59c2c77e Synthesise meta style-entries on demand.
This includes line highlighting, numbers, etc.

Fixes #211.
2018-12-31 11:33:36 +11:00
Alec Thomas
573c1d157d Ensure a newline exists at the end of files.
Fixes #42.
2017-09-29 21:59:52 +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
e5e7b57c46 Fix style tests. 2017-09-21 12:54:18 +10:00
Alec Thomas
86bda70acd Switch to github.com/dlclark/regexp2 2017-09-15 22:18:20 +10:00
Alec Thomas
d852022f8d Move style and formatter API into chroma package. 2017-06-07 19:47:59 +10:00