Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duotone: Add a type option #35359

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/block-supports/duotone.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ function gutenberg_register_duotone_support( $block_type ) {
function gutenberg_render_duotone_filter_preset( $preset ) {
$duotone_id = $preset['slug'];
$duotone_colors = $preset['colors'];
$duotone_type = empty( $preset['type'] ) ? 'table' : $preset['type'];
$filter_id = 'wp-duotone-' . $duotone_id;
$duotone_values = array(
'r' => array(),
Expand Down Expand Up @@ -300,9 +301,9 @@ function gutenberg_render_duotone_filter_preset( $preset ) {
"
/>
<feComponentTransfer color-interpolation-filters="sRGB" >
<feFuncR type="table" tableValues="<?php echo esc_attr( implode( ' ', $duotone_values['r'] ) ); ?>" />
<feFuncG type="table" tableValues="<?php echo esc_attr( implode( ' ', $duotone_values['g'] ) ); ?>" />
<feFuncB type="table" tableValues="<?php echo esc_attr( implode( ' ', $duotone_values['b'] ) ); ?>" />
<feFuncR type="<?php echo esc_attr( $duotone_type ); ?>" tableValues="<?php echo esc_attr( implode( ' ', $duotone_values['r'] ) ); ?>" />
<feFuncG type="<?php echo esc_attr( $duotone_type ); ?>" tableValues="<?php echo esc_attr( implode( ' ', $duotone_values['g'] ) ); ?>" />
<feFuncB type="<?php echo esc_attr( $duotone_type ); ?>" tableValues="<?php echo esc_attr( implode( ' ', $duotone_values['b'] ) ); ?>" />
</feComponentTransfer>
</filter>
</defs>
Expand Down