No results found. Try again with different words?
Search must be at least 3 characters.
- Section
- Troubleshooting – Icons missing from the blocks
- Spectra Patterns
- How to Set Multiple Column Fields in Contact Form 7 Styler of Spectra?
- Styling Checkbox / Radio / Acceptance control in Contact Form 7 Designer block of Spectra
- Unable to Style Checkbox / Radio Buttons / Acceptance Control using Contact Form 7 Styler of Spectra
- Tab Index – for multiple Gravity Forms
- How to Get Started with Spectra
- How to Exclude A Heading from Table of Contents?
- Spectra – Display Conditions for Blocks
- Installing and Importing Starter Templates
- How to Get Started with Spectra
- Manually Install Spectra via FTP
- Automatic Beta Updates for Spectra
- How to Rollback to Previous Spectra Versions
- How to Load Google Fonts Locally
- Activate the Spectra Pro License Key
- How to Install Spectra Pro Plugin
- Translate Spectra Strings using Loco Translate
- How to add a Transparent / Sticky header?
- How to Change the Site Logo?
- How to Change Global Styles?
- How to Disable Title on Posts, Pages?
- How to add a transparent/ sticky header for a single page/post?
- Change Header and Footer Patterns in Spectra One Theme
- Add Custom/Google Fonts In Spectra One
- How to reset global default styling?
- Manually Install Spectra One via FTP?
- Disable or Enable Header/Footer for Specific Pages/Posts
- How can I Change the Contents of the Sidebar?
- Templates and Template Parts in FSE
- How to create Custom Front Page in WordPress
- Frequently Asked Questions
- How to Hide and Show Block Elements?
- How to use Group Blocks or create Containers in Spectra One
- How to clear customizations in Spectra One theme
- What are the Actual Sizes of the Predefined Font Sizes?
- How to make changes to single pages like 404, Archive, Single
- How to change the post/page hero section?
- How to Install Spectra One Theme?
- How to Global Change the Width Using Layouts
- How to Use Sidebar for Page and Post
- What is a Stylebook in FSE?
- How to Change the Global Color Palette?
- Customizing Block Styles in Spectra One Theme
- Understanding Patterns and How to Modify Them in Spectra One Theme
- Changing Sidebar Position for Pages and Posts
- Understanding Duotone and Adding Dynamic Color to SVG
- Exploring Full Site Editing: Creating Websites Made Easy!
- Exploring the “Edit Template” Feature in the Admin Bar
- How to Change the Favicon in Spectra One
- Sticky Header in WooCommerce Based Template
- Integrating Google Analytics into Spectra One Theme
- How to Create a Child Theme for Spectra One
- How to Use WPML for Translating Spectra One Websites
- Accessing the Additional CSS Section in an FSE Theme
Understanding Duotone and Adding Dynamic Color to SVG
Duotone is a technique that allows you to add vibrant colors to images or SVG (Scalable Vector Graphics) files. In our implementation, we have taken it a step further by making it dynamic with global styles, enabling you to apply dynamic color effects. In this easy-to-understand document, we will explain what duotone is and guide you on how to add dynamic colors to SVG using the supported classes: swt-duotone-primary and swt-duotone-secondary.
What is Duotone?
Duotone is a captivating method of enhancing images or SVG files by applying two distinct colors to them. With the rise of digital design and CSS (Cascading Style Sheets), duotone effects can now be applied dynamically to images and SVG files. The primary color typically serves as the highlight or foreground color, while the secondary color acts as the shadow or background color. These contrasting colors work together to bring depth, contrast, and a unique visual style to the image or SVG.
How to Apply Duotone on SVG images?
Here is how you can apply two colors on any SVG image.
Step 1: Select the SVG image and click on the Apply Duotone Filter option from the menu
Step 2: This will open the options to choose the colors. Please choose one of the default colors or you can customize the colors by clicking separate colors for Shadow and Highlights.
Note
How to Add the Class to the SVG icons?
To activate the dynamic version of the Duotone colors, you will need to add the class ID : swt-duotone-primary to the SVG icon under Advanced settings. Here are the steps below:
Step 1: Select the SVG icons on the page where you need to use the Duotone settings
Step 2: Navigate to the block settings and click on Advanced
Step 3: Copy the class ID “swt-duotone-primary” and paste it under the Additional CSS Class option. You can also use the class ID “swt-duotone-secondary”. It is used to convert black svg to white when the styles are changed using style variation
Step 4: Click on the save button to make the changes permanent.
What does Dynamic Duotone do?
The dynamic nature of duotone with CSS enables you to change and manipulate the colors on the fly. By utilizing CSS variables or global style declarations, you can create a dynamic duotone effect that can be easily modified across multiple elements or throughout your entire website or application. This flexibility allows for greater customization and adaptability in achieving the desired visual impact.
Once you have added the aforementioned class to the SVG icons, when you change the theme color, the SVG icons will also change the color based on the different theme colors. Here is an example:
Conclusion
Duotone is a technique that allows you to add eye-catching colors to images or SVG files. By implementing the swt-duotone-primary and swt-duotone-secondary classes and defining the primary and secondary colors using global styles, you can create dynamic duotone effects. Experiment with different color combinations and adjust the global styles to achieve the desired visual impact. Embrace the power of duotone and dynamic colors to make your SVGs more engaging and visually appealing across your website or application.
We don't respond to the article feedback, we use it to improve our support content.