[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/block-supports/ -> duotone.php (summary)

Duotone block support flag. Parts of this source were derived and modified from TinyColor, released under the MIT license.

File Size: 586 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 11 functions

  wp_tinycolor_bound01()
  _wp_tinycolor_bound_alpha()
  wp_tinycolor_rgb_to_rgb()
  wp_tinycolor_hue_to_rgb()
  wp_tinycolor_hsl_to_rgb()
  wp_tinycolor_string_to_rgb()
  wp_get_duotone_filter_id()
  wp_get_duotone_filter_property()
  wp_get_duotone_filter_svg()
  wp_register_duotone_support()
  wp_render_duotone_support()

Functions
Functions that are not part of a class:

wp_tinycolor_bound01( $n, $max )   X-Ref
Takes input from [0, n] and returns it as [0, 1].

Direct port of TinyColor's function, lightly simplified to maintain
consistency with TinyColor.

since: 5.8.0
return: float Value in the range [0, 1].
param: mixed $n   Number of unknown type.
param: int   $max Upper value of the range to bound to.

_wp_tinycolor_bound_alpha( $n )   X-Ref
Direct port of tinycolor's boundAlpha function to maintain consistency with
how tinycolor works.

since: 5.9.0
return: float Value in the range [0,1].
param: mixed $n Number of unknown type.

wp_tinycolor_rgb_to_rgb( $rgb_color )   X-Ref
Rounds and converts values of an RGB object.

Direct port of TinyColor's function, lightly simplified to maintain
consistency with TinyColor.

since: 5.8.0
return: array Rounded and converted RGB object.
param: array $rgb_color RGB object.

wp_tinycolor_hue_to_rgb( $p, $q, $t )   X-Ref
Helper function for hsl to rgb conversion.

Direct port of TinyColor's function, lightly simplified to maintain
consistency with TinyColor.

since: 5.8.0
return: float R, G, or B component.
param: float $p first component.
param: float $q second component.
param: float $t third component.

wp_tinycolor_hsl_to_rgb( $hsl_color )   X-Ref
Converts an HSL object to an RGB object with converted and rounded values.

Direct port of TinyColor's function, lightly simplified to maintain
consistency with TinyColor.

since: 5.8.0
return: array Rounded and converted RGB object.
param: array $hsl_color HSL object.

wp_tinycolor_string_to_rgb( $color_str )   X-Ref
Parses hex, hsl, and rgb CSS strings using the same regex as TinyColor v1.4.2
used in the JavaScript. Only colors output from react-color are implemented.

Direct port of TinyColor's function, lightly simplified to maintain
consistency with TinyColor.

since: 5.8.0
since: 5.9.0 Added alpha processing.
return: array RGB object.
param: string $color_str CSS color string.

wp_get_duotone_filter_id( $preset )   X-Ref
Returns the prefixed id for the duotone filter for use as a CSS id.

since: 5.9.1
return: string Duotone filter CSS id.
param: array $preset Duotone preset value as seen in theme.json.

wp_get_duotone_filter_property( $preset )   X-Ref
Returns the CSS filter property url to reference the rendered SVG.

since: 5.9.0
return: string Duotone CSS filter property url value.
param: array $preset Duotone preset value as seen in theme.json.

wp_get_duotone_filter_svg( $preset )   X-Ref
Returns the duotone filter SVG string for the preset.

since: 5.9.1
return: string Duotone SVG filter.
param: array $preset Duotone preset value as seen in theme.json.

wp_register_duotone_support( $block_type )   X-Ref
Registers the style and colors block attributes for block types that support it.

since: 5.8.0
param: WP_Block_Type $block_type Block Type.

wp_render_duotone_support( $block_content, $block )   X-Ref
Render out the duotone stylesheet and SVG.

since: 5.8.0
return: string Filtered block content.
param: string $block_content Rendered block content.
param: array  $block         Block object.



Generated: Fri Apr 19 01:00:02 2024 Cross-referenced by PHPXref 0.7.1