Releases: ajalt/colormath
Releases · ajalt/colormath
3.1.0
3.0.0
Version 3.0.0 is a major release with new functionality and improved precision and standards compliance.
Added
- New color models:
Oklab
,Oklch
,HWB
,HPLuv
,HSLuv
,LCHab
,LCHuv
,JzAzBz
,JzCzHz
,ICtCp
- New RGB color spaces:
Linear sRGB
,ACES
,ACEScc
,ACEScct
,ACEScg
,Adobe RGB
,BT.2020
,BT.709
,DCI P3
,Display P3
,ProPhoto
- Other color spaces:
LABColorSpace
,LCHabColorSpace
,LCHuvColorSpace
,LUVColorSpace
,XYZColorSpace
- WCAG contrast:
wcagLuminance
,wcagContrastRatio
,mostContrasting
,firstWithContrast
- Color difference:
euclideanDistance
,differenceCIE76
,differenceCIE94
,differenceCIE2000
,differenceCMC
,differenceEz
- Transforms:
Color.map
,mix
,multiplyAlpha
,divideAlpha
,createChromaticAdapter
,RGBColorSpace.converterTo
- Interpolation:
Color.interpolate
,ColorSpace.interpolator
- Color metadata:
ColorSpace
,Color.space
,Color.toArray
,ColorSpace.create
- CSS parsing and rendering now support all CSS color strings
RGBInt
: an inline class that storesRGB
colors packed in a single Int. Create instances directly, or convert to it withRGB.toRGBInt()
- Publish
macosArm64
target.
Changed
- All
Color
classes now store their color components asFloat
RGB
,XYZ
, HSV,
HSL, and
HWBnow store their rectangular components normalized to
[0, 1]`.- Renamed
Color.fromCss
toColor.parse
. - All
Color
constructors now usealpha
as name of their final parameter. - Replace
toCssRgb
andtoCssHsl
withfromatCssString
that supports all color models. - All color models moved from the package
com.github.ajalt.colormath
tocom.github.ajalt.colormath.model
- Updated Kotlin to 1.5.30
Removed
- Removed the previously deprecated
ConvertibleColor
typealias. - Removed the
CssColors
object. UseColor.fromCss
instead. - Removed
Ansi16
companion object color constants. - Removed
Color.toHex()
. UseRGB.toHex()
instead.
2.1.0
Added
- Added CIE LUV colorspace support
- Added CIE LCH(uv) colorspace support
- Added HWB colorspace support
- Added
lab()
andhwb()
support toColor.fromCss
- JS target now publishes IR format in addition to legacy jars
Changed
- Updated Kotlin to 1.5.0
Color.fromCss
now clamps out-of-range values in accordance with the CSS Color Module Level 4 spec
2.0.0
1.4.1
1.4.0
Added
hueAsRad()
,hueAsGrad()
, andhueAsTurns()
extensions forHSL
andHSV
classes.toHex()
now has arenderAlpha
parameter that lets you render the color's alpha channel in the hex. By default the alpha will be added if it's < 1.toCssRgb()
andtoCssHsl()
extensions to render colors as CSS color functionsRGB.toPackedInt()
to convert a color to a single integer.
Changed
withNumberSign
parameter oftoHex
now defaults totrue
ColorMath.parseCssColor()
renamed toConvertableColor.fromCss()
andColorMath.cssKeywordColors
toCssColors.colorsByName
1.3.0
Added
- All colors now have an
alpha
channel, defaulting to 1 (fully opaque). For colorspaces that support transparency, you can pass an alpha value into their constructors. ColorMath.parseCssColor()
can parse all valid HTML/CSS colors, including rgb, hsl, and named colors.ColorMath.cssKeywordColors
is a map of HTML/CSS color names to RGB the colors they represent.