If you mean wp.components.ColorPicker
which is based on react-color, then the tint
object also contains a rgb
property with an object of the RGBA value like {r: 51, g: 51, b: 51, a: 1}
.
So in your code, you can use:
style={{ backgroundColor: `rgba(${tint.rgb.r}, ${tint.rgb.g}, ${tint.rgb.b}, ${tint.rgb.a})` }}
And an easy trick to know all the available properties in the color object is by running console.log( tint )
.. 🙂
Related Posts:
- Gutenberg disallow certain custom blocks but keep all core blocks?
- Gutenberg: Error loading block: Invalid parameter(s): attributes but it can be used in the code
- How to disable Gutenberg editor?
- Getting a custom Gutenberg component’s state from outside that component
- How to create gutenberg block using REST API independently or as headless way?
- Show missing Sidebar from Gutenberg admin area
- Gutenberg: How to use output of php render_callback function in the block editors backend?
- Gutenberg: How to use block attributes with ServerSideRenderer?
- Gutenberg: Difference between “import” and “const” for dependencies
- Gurenberg Block: How to migrate from el-Functions to JSX elements?
- Gutenberg Block: Objects are not valid as a React child (found: [object HTMLDivElement])
- How to add custom style to Gutenberg?
- Difference between register_block_type & wp.blocks.registerBlockType
- Passing RichText attributes to function onChange
- Can I share predefined fonts from theme_support with a gutenberg component?
- How do I store information in a dynamic block in WordPress?
- Gutenberg List Extension Block
- Changing image size to full size in Gutenberg’s block gallery
- Check for Active WordPress Plugins from the Block Editor
- Gutenberg Blocks – Change EDIT part of the block using editor.BlockEdit filters. How to change the markup?
- How to create custom embed block in gutenberg wordpress
- How to get variables from fucntion.php to my plugin files
- Gutenberg: How to refresh ServerSideRender with useSelect and AsyncModeProvider true?
- How to use get_theme_mod in gutenberg editor wordpress?
- Plugin echos text from shortcode function in gutenberg page editor
- How do I prevent the link from using url of the image in Block Editor?
- Plugin. Html code in Template
- how to disable blockrenderAppender inside all Innerblocks?
- Cannot find a list of data selectors for Gutenberg editor
- WordPress Gutenberg react make import of __experimentalUseInnerBlocksProps which is no more experimetal
- Add button gutenberg help
- Gutenberg block can’t save richtext
- Use gutenberg block editor on plugin page (outside of a post)
- Using SVN to upload plugin created with gutenberg blocks
- I am not receiving className in a ServerSideRender component
- Woocommerce Create custom product type with variations
- Gutenberg: Block SelectControl saves attributes but after a reload of Gutenberg it loads its defaults. Why?
- Would Gutenberg be considered a PlugIn?
- Can’t get Gutenberg InspectorControls to work
- Gutenberg Block Style CSS Class Is Not Applying on Backend
- Why is the ‘Gutenberg’ Plugin generating an ‘Inconsistent File Permissions’ error when other Plugins, with the same permissions, do not?
- Passing stored variables to add_filter
- How to find out whether a plugin is used in pages or posts?
- “uagb/section and uagb/columns block”
- Add text to variable
- React error #231with Custom Blocks after upgrade to WP 5.5
- serverSideRender does not render “preview” html inside Gutenberg block
- How to have a gallery in which each image’s caption is a whole “post”?
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Passing PHP Variables to AJAX Loaded Pages
- Shortcode and variable
- What’s the best way to echo out a filter variable?
- Defining the value of a variable before a function?
- Elementor Combined all Sections into 1 Text Editor
- Use a custom block in another block
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- How can I disable an attribute from a Gutenberg block included in a template via InnerBlocks?
- How to make if statement in react plugin?
- WordPress latest core update conflicting with newspack-newsletter plugin
- Gutenberg: Prevent links from being clickable in the block. Error: “Cannot destructure property ‘frameElement’ of ‘r’ as it is null.”
- How to display emails as a post?
- Javascript console errors and WSOD on edit post pages
- @wordpress/scripts advanced usage
- Has blocks gutenberg block multiples registers type in my Plugin
- Fixed: Console.log twice in the edit function
- Possible way of having multiple Gutenberg instances for a page?
- How to resolve warning for `unstableOnSplit` prop on a DOM element in block editor
- WordPress Gutenberg How to make TextControl Required?
- Gutenberg Block: How to reload a ServerSideRender?
- How to change the width of certain paragraph or header blocks?
- After Update Advanced Gutenberg Plugin – advgb/container site does not support block
- Passing function into add_action always returns the first argument
- Defining constant in a plugin to use in another plugin
- Block content rendering on the top just below body tag
- Looking for Image Slider that is based on default WP Media Library
- Gutenberg editor in WordPress 5.0.3 /wp-json/wp/v2/pages/4713/autosaves?_locale=user 500 (Internal Server Error)
- How to display variables from plugin?
- fix undefined variable in native wp files
- Passing variable from template file to the plugin file
- Editing Global Variables from Inside Functions
- Gutenberg: Dynamic Block – Show saved data in the editor
- Global Handle to Class unavailable in Plugin?
- Create plugin with multiple blocks
- How to change post status to draft in Gutenberg?
- Custom gutenberg block image preview not working
- How can I utilize the same “show more” functionality that I see in superuser on my own WordPress site?
- Gutenberg Block to Select Category Term
- Refresh server side rendered block in Gutenberg without changing attributes or its content
- How do I set register_meta for a specific CPT?
- Block Missing from Inserter When Following Block Tutorial
- How do I save meta key value in the save function?
- Update Content for a Custom Block Toolbar Button
- How to save mediaupload multiple URLs as array meta?
- How can I display an attribute from each post inside foreach($latest_posts1 as $post )
- Wrong block appender button showing
- How to get attributes from block.js into php
- How to get custom setting from get_option and pass it in getEntityRecords in gutenberg block?
- Accessible ‘List Carousel’ block/pattern?
- Vanilla javascript in custom gutenberg block not working
- WordPress custom block: Link saved in database not retrieved when editing post