• Resolved Kamilionare

    (@kamilionare)


    Please let me know how to make support for alpha colors in the new version of the plugin.
    ‘choices’ => [
    ‘alpha’ => true,
    ],
    Now allows to select only the color but cannot select the transparency.
    Thanks,

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @kamilionare,

    I was not able to replicate this on my end. The alpha color picker works fine for me with the current version of WordPress and the upcoming 5.5 release.

    Code I used to test:

    Kirki::add_field( 'theme_config_id', [
    	'type'        => 'color',
    	'settings'    => 'color_setting_rgba',
    	'label'       => __( 'Color Control (with alpha channel)', 'kirki' ),
    	'description' => esc_html__( 'This is a color control - with alpha channel.', 'kirki' ),
    	'section'     => 'kirki_options',
    	'default'     => '#0088CC',
    	'choices'     => [
    		'alpha' => true,
    	],
    ] );
    Thread Starter Kamilionare

    (@kamilionare)

    I have this code, and check screen results please
    Kirki::add_field( ‘kirki’, [
    ‘type’ => ‘color’,
    ‘settings’ => ‘my_id’,
    ‘description’ => esc_html__( ‘Content text color’ ),
    ‘section’ => ‘contstyl’,
    ‘default’ => ‘#999’,
    ‘transport’ => ‘auto’,
    ‘choices’ => [
    ‘alpha’ => true,
    ],
    ‘output’ => [
    [
    ‘element’ => ‘p, .oxntags.textcenter > a’,
    ‘property’ => ‘color’,
    ],

    screen https://ibb.co/fx7pD5m

    Looks like your code is missing closing tags at the bottom, please try this:

    Kirki::add_field( 'kirki', [
    	'type' => 'color',
    	'settings' => 'my_id',
    	'description' => esc_html__( 'Content Text Color' ),
    	'section' => 'contstyl',
    	'default' => '#999',
    	'transport' => 'auto',
    	'choices' => [
    		'alpha' => true,
    	],
    	'output' => [
    		[
    			'element' => 'p',
    			'property' => 'color',
    		],
    	],
    
    ] );
    Thread Starter Kamilionare

    (@kamilionare)

    It is there closed. Please, sorry I’m just not copying fully code. Any way the unclosed tag will call fatal error.

    • This reply was modified 4 years, 8 months ago by Kamilionare.

    Can you try if this works with the TwentyTwenty theme installed, the latest version of the Kirki plugin activated and the code above added to the functions.php?

    It does work for me so I’m assuming something else is conflicting with Kirkis color picker.

    Thread Starter Kamilionare

    (@kamilionare)

    Yes, it works there.
    Don’t know why, but it happened when I have moved the website to another domain. ??
    I got this error on my console:
    wp-color-picker-alpha.js?ver=3.1.3:21 Uncaught TypeError: Cannot read property ‘__’ of undefined
    at wp-color-picker-alpha.js?ver=3.1.3:21
    at wp-color-picker-alpha.js?ver=3.1.3:478

    Maybe you have some ideas to solve this?
    I have already cleaned all the transitions and cache

    • This reply was modified 4 years, 8 months ago by Kamilionare.

    This is going to be fixed with the next release! ??

    Best,
    David

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘No alfa color control support with new version’ is closed to new replies.