Releases: adobe/leonardo
@adobe/[email protected]
Minor Changes
- 7385295: Add
colorSpaceas the canonical property name and deprecatecolorspace(non-breaking). The constructor,Theme.updateColor, andcreateScale()accept both names;colorSpacetakes precedence. The oldcolorspacegetter/setter remain as deprecated aliases and emit a console warning. TypeScript types includecolorSpaceand markcolorspaceas@deprecated. Existing code continues to work.
@adobe/[email protected]
Patch Changes
- 35073e8: Upgrade chroma-js from ^2 to ^3 and hsluv from ^0.1 to ^1.0. The hsluv 1.0 class-based API is wrapped internally so the public interface is unchanged. Color output for HSLuv-interpolated scales may differ by a small precision amount due to updated interpolation in the new libraries.
@adobe/[email protected]
Changes
- 342c9ca: Migrated from Lerna to Moon for monorepo management.
- Setting up Changeset for release management
- Setting up automated releases on NPM
- Migrate from Jest to Ava for better module support
Graduated from alpha.
@adobe/[email protected]
✨ Refactored core functions into Classes ✨
Class functions allow us to generate color scales only when necessary, such as when key colors or interpolation space change. Previously, these scales would regenerate when any parameter is changed. When using "smooth" interpolation, this dramatically slows down color output.
This architecture makes modification to a theme more performant in that you can set parameters that only affect their dependent functionality, rather than re-running the entire generateAdaptiveTheme function any time a change is made. This particularly is useful when setting lightness or the contrast of your theme.
This release includes:
- Replaced
generateContrastColors,generateBaseScale, andgenerateAdaptiveThemefunctions with new classes - Added classes
Color,BackgroundColor, andTheme - Renamed
fixColorVauetoconvertColorValuesince the function name did not match what it does. - Renamed
binarySearchtogetMatchingRatioIndexsince the function is more than just a binary search and specific to finding a matching ratio's index - Enhanced
getMatchingRatioIndexto find next highest contrast value for positive contrasts and next smallest value for negative contrasts.
For more detail see PR #110