Custom Iris Palette Color Picker for Sparklin WordPress Theme

Hi @Movin,

I need to set custom color into Iris Palette, Color Picker.

I tried some code edits but didn’t work.

Could you help me?

http://automattic.github.io/Iris/

Hi @FuoriLuogo,

I hope you are well today and thank you for your question.

Do you want to change it in any particular theme option or is it not related to theme at all?

Please advise.

Kind Regards,
Movin

No, I follow some guide to change it for every wordpress theme but it did’t work.
I think Sparkling Theme has something different, so I want to chage it in Sparkling Theme only at the moment.

Thanks @Movin

You can set custom color into Iris Palette, Color Picker by using the attached plugin that contains following code.

// customise palette colours
function firefly_customize_controls_print_footer_scripts() {
?>
    <script>
        jQuery(document).ready(function($){
            $.wp.wpColorPicker.prototype.options = {
                palettes: ['#ffffff', '#000000','#dd3333', '#dd9933','#eeee22', '#81d742', '#ff0000']
            };
        });
    </script>
<?php
}
add_action('customize_controls_print_footer_scripts', 'firefly_customize_controls_print_footer_scripts');

You can change the color code ‘#ff0000’ in the above plugin code to add your custom color in the Iris Palette.

Hi @Movin,

Your plugin works great in customization panel!

Unfortunately it doesn’t work in shortcodes.

Do you know why?

Thanks a lot!

Hi @FuoriLuogo,

I have developed the code for Iris Palette Color Picker of Sparkling theme so if it’s not working with the shortcodes provided by any plugin then you should contact the plugin developer regarding this as it will need to develop more custom code to make it work with the shortcode.

Developing custom code for custom functionality is beyond the scope of support that we provide here.

If you are not a developer then you can consider hiring a developer to develop it for you. You can hire a developer from any freelance site. Colorlib recommends the developer https://www.upwork.com/freelancers/~011652ffec8865c6d5

Best Regards,
Movin

Thank you very much!

You are most welcome here :slight_smile: