Releases: LDrender/gradient-picker
Releases · LDrender/gradient-picker
v2.0.4
v2.0.3
Add directionRadial parameter
Performance optmisation
Full Changelog: v2.0.0...v2.0.3
v2.0.1
Breaking Changes
- Renamed preview-related DOM elements to slider for better semantic clarity
gradient-picker__previewis now used for the new preview window- Former preview element is now
gradient-picker__slider
Features
- Added optional preview window
- New
previewoption in constructor (default: false) - Preview window shows real-time gradient above options
- Full display of gradient with selected type and direction
- New
- Enhanced color format support
- Added support for named CSS colors
- Added support for RGB/RGBA format
- Added support for HSL/HSLA format
- Automatic color normalization to hexadecimal format
- Preserved original color format in output
Performance
- Improved touch event handling
- Added passive event listeners for better scroll performance
- Fixed Chrome warnings for scroll-blocking events
- Optimized touch interaction on mobile devices
Documentation
- Updated README with new features and examples
- Added comprehensive color format documentation
- Added preview window configuration examples
- Updated DOM structure documentation
- Added new TypeScript interfaces and types
Internal
- Improved code structure
- Added ColorUtils class for color handling
- Added GradientValidation class
- Enhanced error handling for color validation
- Added color normalization logic
- Reorganized component structure to support preview feature
Migration Guide
When upgrading from 1.x to 2.0.0:
-
DOM Structure Updates:
<!-- Old structure --> <div class="gradient-picker"> <div class="gradient-picker__preview">...</div> </div> <!-- New structure --> <div class="gradient-picker"> <div class="gradient-picker__preview">...</div> <!-- Optional preview window --> <div class="gradient-picker__slider">...</div> <!-- Former preview element --> </div>
-
CSS Selectors:
- Update any custom CSS targeting
.gradient-picker__previewto.gradient-picker__slider - Add new styles for
.gradient-picker__previewif using the preview feature
- Update any custom CSS targeting
-
New Options:
const gradientPicker = new GradientPicker({ el: '#gradient-picker', preview: true, // Optional: enable preview window // ... other options remain the same });
v1.4.0
Full Changelog: 1.2.8...1.4.0