v3.0.0
Features
- Added detection of color spaces support: TrueColor, 256 colors, 16 colors, no color (black & white).
- Added fallback for supported color space: truecolor —> 256 colors —> 16 colors —> no colors.
- Improved performance for the
hex()
function.
BREAKING CHANGE
In the new major version 3.x
are removed unused styles and methods.
⚠️ WarningBefore update, please check your code whether is used deleted styles and methods.
Support Node.js
Drop supports for Node <= 14
. Minimal supported version is 15.0.0
(Released 2020-10-20).
In the theory the v3
can works with Node12
, but we can't test it.
Deleted styles
The not widely supported
styles are deleted:
faint
(alias for dim), replace in your code withdim
doubleUnderline
, replace in your code withunderline
frame
, replace in your code withunderline
encircle
, replace in your code withunderline
overline
, replace in your code withunderline
Deleted methods
The methods are deleted:
ansi
, replace in your code withansi256
orfg
bgAnsi
, replace in your code withbgAnsi256
orbg
Deleted clamp in functions
The clamp (0, 255) for the ANSI 256 codes and RGB values is removed, because is unused.
You should self check the function arguments.
The affected functions:
ansi256
andfg
(alias to ansi256) - expected a code in the range0 - 255
bgAnsi256
andbg
(alias to bgAnsi256) - expected a code in the range0 - 255
rgb
- expected r, g, b values in the range0 - 255
bgRgb
- expected r, g, b values in the range0 - 255