Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
Clone or download
kallookoo Merge pull request #20 from nicolafranchini/master
Trigger input change if used inside wp customizer
Latest commit e00af21 May 8, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist Trigger input change if used inside wp customizer Apr 6, 2018
src Trigger input change if used inside wp customizer Apr 6, 2018
Readme.md Update Readme.md Nov 24, 2017

Readme.md

wp-color-picker-alpha

Only run in input and is defined data alpha in true

Screenshots

wpColorPicker

wpcolorpicker-01

wpColorPicker in mode Alpha Channel

wpcolorpicker-02 wpcolorpicker-03

Installation

Download and copy script inside folder dist in you theme options or plugin. For call this script use this code:

wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker-alpha', $url_to_script, array( 'wp-color-picker' ), $current_version, $in_footer );

Usage

Add class .color-picker and data-alpha="true" in input.

This class is optional but then need to call wpColorPicker yourself to the class you want.

Optional
  • data-reset-alpha:

  • For set Alpha Channel for disabled transparency after press color palette.

  • data-custom-width:

  • By default the input width is 100 on rgba mode

  • For disabled default input witdh in mode rgba ( Possible values: "false", "0" )

  • For change default input width in mode rgba ( change the number you want, "in pixels" )

License

Licensed under the GPLv2 license.

Support

If you would like to contribute please fork the project and report bugs or submit pull requests.

Tested

If only tested in Firefox and WordPress last versions

Testing

For only testing download or clone wp-color-picker-alpha-plugin inside WordPress plugins folder and activate.

Changelog

v2.1.3
  • Fix issue #13, Thanks for @jtsternberg, see #15
v2.1.2
  • Declare some global variables when is deprecated or not
  • Change method to check WordPress version, recommended by @webaware, see comments
v2.1.1
  • Change method to check WordPress version
v2.1
  • Resolve issues with wp-color-picker.css, see #12

The variable wpColorPickerL10n is used to check if it is earlier than version 4.9 and adjusts the content, only tested in 4.8.3 and 4.9-RC2-42156.

v2.0
  • Add support for WordPress 4.9, also works in lower versions, only tested in version 4.8
v1.2.2
  • Pull, see #7
v1.2.1
  • Pull, see #4
v1.2
  • Add functionality to change the width of the element, see #2
v1.1
  • Fixed issue #1
  • Show Iris error always, but if not is empty input
  • Fixed option reset, not reset in first time
  • Fixed width input with data alpha is true and plugin initialize
v1.0.0

Initial Release