wp-content/themes/twentynineteen/inc/color-patterns.php:13Generate the CSS for the current primary color.
6 hooks fire while twentynineteen_custom_colors_css() runs, in this order:
Filters Twenty Nineteen default saturation level.
Filters Twenty Nineteen default selection saturation level.
Filters Twenty Nineteen default lightness level.
Filters Twenty Nineteen default hover lightness level.
Filters Twenty Nineteen default selection lightness level.
Filters Twenty Nineteen custom colors CSS.
<?phpfunction twentynineteen_custom_colors_css() { $primary_color = 199; if ( 'default' !== get_theme_mod( 'primary_color', 'default' ) ) { $primary_color = absint( get_theme_mod( 'primary_color_hue', 199 ) ); } /** * Filters Twenty Nineteen default saturation level. * * @since Twenty Nineteen 1.0 * * @param int $saturation Color saturation level. */ $saturation = apply_filters( 'twentynineteen_custom_colors_saturation', 100 ); $saturation = absint( $saturation ) . '%'; /** * Filters Twenty Nineteen default selection saturation level. * * @since Twenty Nineteen 1.0 * * @param int $saturation_selection Selection color saturation level. */ $saturation_selection = absint( apply_filters( 'twentynineteen_custom_colors_saturation_selection', 50 ) ); $saturation_selection = $saturation_selection . '%'; /** * Filters Twenty Nineteen default lightness level. * * @since Twenty Nineteen 1.0 * * @param int $lightness Color lightness level. */ $lightness = apply_filters( 'twentynineteen_custom_colors_lightness', 33 ); $lightness = absint( $lightness ) . '%'; /** * Filters Twenty Nineteen default hover lightness level. * * @since Twenty Nineteen 1.0 * * @param int $lightness_hover Hover color lightness level. */ $lightness_hover = apply_filters( 'twentynineteen_custom_colors_lightness_hover', 23 ); $lightness_hover = absint( $lightness_hover ) . '%'; /** * Filters Twenty Nineteen default selection lightness level. * * @since Twenty Nineteen 1.0 * * @param int $lightness_selection Selection color lightness level. */ $lightness_selection = apply_filters( 'twentynineteen_custom_colors_lightness_selection', 90 ); $lightness_selection = absint( $lightness_selection ) . '%'; $theme_css = ' /* * Set background for: * - featured image :before * - featured image :before * - post thumbnail :before * - post thumbnail :before * - Submenu * - Sticky Post * - buttons * - WP Block Button * - Blocks */ .image-filters-enabled .site-header.featured-image .site-featured-image:before, .image-filters-enabled .site-header.featured-image .site-featured-image:after, .image-filters-enabled .entry .post-thumbnail:before, .image-filters-enabled .entry .post-thumbnail:after, .main-navigation .sub-menu, .sticky-post, .entry .entry-content .wp-block-button .wp-block-button__link:not(.has-background), .entry .button, button, input[type="button"], input[type="reset"], input[type="submit"], .entry .entry-content > .has-primary-background-color, .entry .entry-content > *[class^="wp-block-"].has-primary-background-color,Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-content/themes/twentynineteen/inc/color-patterns.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.