kallookoo / wp-color-picker-alpha

Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alpha channel is not showing

LuigiCaradonna opened this issue · comments

I have set an input field as follows

<input type="text" class="color-picker" data-alpha-enabled="true" name="kam_bg_color" value="rgba(0,0,0,0.6)"/>

The picker shows up and I can use it, but the slider for the alpha channel does not appear.

Tried on Firerox 129.0.2 (64 bit) and Brave 1.69.160, both for Windows.

Hello,

Could you share how you include the javascript file and the javascript code to create the color picker.

From what you say, it seems that what happens to you is because of what I said before.

This is what I do

wp_register_script( 
	'wp-color-picker-alpha', 
	PLUGIN_URL . 'assets/js/wp-color-picker-alpha.min.js', 
	array( 'wp-color-picker' ), 
	'3.0.4', 
	true 
);
wp_add_inline_script(
	'wp-color-picker-alpha',
	'jQuery( function() { jQuery( ".color-picker" ).wpColorPicker(); } );'
);
wp_enqueue_script( 'wp-color-picker-alpha' );
<input type="text" class="color-picker" data-alpha-enabled="true" name="kam_bg_color" value="rgba(0,0,0,0.6)"/>

Sorry, but from what you say you must have some kind of error that is not related to the script.
Also I see that you do not include the CSS and use a constant so it could be the cause or that someone loads the wp-color-picker and is giving problems.