Skip to content

Releases: LDrender/gradient-picker

v2.0.4

19 Nov 17:48

Choose a tag to compare

Fix not apply parameters

v2.0.3

19 Nov 17:20

Choose a tag to compare

Add directionRadial parameter
Performance optmisation

Full Changelog: v2.0.0...v2.0.3

v2.0.1

19 Nov 13:21

Choose a tag to compare

Breaking Changes

  • Renamed preview-related DOM elements to slider for better semantic clarity
    • gradient-picker__preview is now used for the new preview window
    • Former preview element is now gradient-picker__slider

Features

  • Added optional preview window
    • New preview option in constructor (default: false)
    • Preview window shows real-time gradient above options
    • Full display of gradient with selected type and direction
  • 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:

  1. 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>
  2. CSS Selectors:

    • Update any custom CSS targeting .gradient-picker__preview to .gradient-picker__slider
    • Add new styles for .gradient-picker__preview if using the preview feature
  3. New Options:

    const gradientPicker = new GradientPicker({
      el: '#gradient-picker',
      preview: true, // Optional: enable preview window
      // ... other options remain the same
    });

v1.4.0

27 Jul 12:50

Choose a tag to compare

Full Changelog: 1.2.8...1.4.0

v1.2.8

24 Jun 13:06

Choose a tag to compare

Fix the deletion error of previously created colors (if you delete a color after creating one, this will generate an error)