package spectrum_tools
Color conversion and terminal color utilities for Spectrum
Install
dune-project
Dependency
Authors
Maintainers
Sources
1.0.0.alpha.tar.gz
md5=ea03607c966079dcdfaed8a754b91912
sha512=f11d6c90f3658a695f3ed948ff8097970b3b5205c56a7f765d5fea8c0c841cf33bf00b4050771e1c455416ec59ecb0fda9c4b24c39f9679bf00b9e31c8f61a63
doc/CHANGELOG.html
Changelog
1.0.0.alpha
Major enhancements!
- automatic color quantization: RGB and HSL colors are now automatically downsampled to ANSI-256 or ANSI-16 based on detected terminal capabilities
- perceptual color matching: use LAB color space with octree-based nearest-neighbor search for accurate color quantization
- unified converter architecture: removed legacy
ChalkandImprovedChalkconverters in favor of thePerceptualconverter - custom palette support: architecture now supports arbitrary palettes via JSON sources
- package split:
spectrum(main runtime),spectrum_palette(palette definitions),spectrum_palette_ppx(palette codegen PPX),spectrum_tools(color conversion utilities), andspectrum_palettes(generated palette modules) - palette JSON definitions live in
lib/spectrum_palette/*.json, with PPX-generated modules inlib/spectrum_palettes/terminal.ml Spectrum.Stagmodule: type-safe variant-based API forFormat.stag, allowing pre-validated tag construction with zero parsing overhead as an alternative to string tagsspectrum_capabilitiespackage: terminal capability detection extracted into a standalone opam package (zero dependency on the rest of Spectrum)- property-based tests: QCheck2 property tests for parser, lexer, color conversions, capabilities detection, and stag/string-tag equivalence
- comprehensive test coverage: all modules now tested
- odoc documentation: comprehensive API docs with examples
0.7.0
- minimum OCaml version raised to 4.14
- replace
pcredependency withre(pure OCaml)
0.6.0
- finally understood what the interface should be 😅
- expose main interface via the parent
Spectrummodule (instead ofSpectrum.Printeras it used to be) - main interface is now
Spectrum.prepare_ppf, allowing Spectrum tag handling with the usualFormat.printfmethods, with the usual buffering behaviour in user's control - "instant gratification" interface (previously our main interface) is now
Spectrum.Simple.printfand friends, having the always-flush buffer behaviour - changed the colour names in
Basicrange to match the list at https://www.ditig.com/256-colors-cheat-sheet - make
%char optional in HSL colours, to avoid ugly escaping
0.5.0
- support CSS-style
rgb(...)andhsl(...)color tags
0.4.0
- port the terminal colour capabilities detection from chalk.js
0.3.0
- expose separate
ExnandNoexninterfaces - fix for buffer interaction issue (tests broke when updating dep
Fmt.0.9.0) ...probably affected most uses ofsprintf_into - replace
sprintf_intokludge with a workingsprintfimplementation
0.2.0
- first viable version