[ 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: 432 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 functions

  wp_tinycolor_bound01()
  wp_tinycolor_rgb_to_rgb()
  wp_tinycolor_hue_to_rgb()
  wp_tinycolor_hsl_to_rgb()
  wp_tinycolor_string_to_rgb()
  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.

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

wp_tinycolor_rgb_to_rgb( $rgb_color )   X-Ref
Round and convert values of an RGB object.

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

param: array $rgb_color RGB object.
since: 5.8.0
return: array Rounded and converted 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.

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

wp_tinycolor_hsl_to_rgb( $hsl_color )   X-Ref
Convert 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.

param: array $hsl_color HSL object.
since: 5.8.0
return: array Rounded and converted RGB 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
and the alpha value is ignored as it is not used in duotone.

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

param: string $color_str CSS color string.
since: 5.8.0
return: array RGB object.

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

param: WP_Block_Type $block_type Block Type.
since: 5.8.0

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

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



Generated: Mon Sep 20 01:00:04 2021 Cross-referenced by PHPXref 0.7.1