wp_tinycolor_rgb_to_rgb

The timeline below displays how wordpress function wp_tinycolor_rgb_to_rgb has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Rounds and converts values of an RGB object.
 *
 * Direct port of TinyColor's function, lightly simplified to maintain
 * consistency with TinyColor.
 *
 * @link https://github.com/bgrins/TinyColor
 *
 * @since 5.8.0
 * @deprecated 6.3.0
 *
 * @access private
 *
 * @param array $rgb_color RGB object.
 * @return array Rounded and converted RGB object.
 */
function wp_tinycolor_rgb_to_rgb($rgb_color)
{
    _deprecated_function(__FUNCTION__, '6.3.0');
    return array('r' => wp_tinycolor_bound01($rgb_color['r'], 255) * 255, 'g' => wp_tinycolor_bound01($rgb_color['g'], 255) * 255, 'b' => wp_tinycolor_bound01($rgb_color['b'], 255) * 255);
}

WordPress Version: 5.9

/**
 * Rounds and converts values of an RGB object.
 *
 * Direct port of TinyColor's function, lightly simplified to maintain
 * consistency with TinyColor.
 *
 * @see https://github.com/bgrins/TinyColor
 *
 * @since 5.8.0
 * @access private
 *
 * @param array $rgb_color RGB object.
 * @return array Rounded and converted RGB object.
 */
function wp_tinycolor_rgb_to_rgb($rgb_color)
{
    return array('r' => wp_tinycolor_bound01($rgb_color['r'], 255) * 255, 'g' => wp_tinycolor_bound01($rgb_color['g'], 255) * 255, 'b' => wp_tinycolor_bound01($rgb_color['b'], 255) * 255);
}

WordPress Version: 5.8

/**
 * Round and convert values of an RGB object.
 *
 * Direct port of TinyColor's function, lightly simplified to maintain
 * consistency with TinyColor.
 *
 * @see https://github.com/bgrins/TinyColor
 *
 * @since 5.8.0
 * @access private
 *
 * @param array $rgb_color RGB object.
 *
 * @return array Rounded and converted RGB object.
 */
function wp_tinycolor_rgb_to_rgb($rgb_color)
{
    return array('r' => wp_tinycolor_bound01($rgb_color['r'], 255) * 255, 'g' => wp_tinycolor_bound01($rgb_color['g'], 255) * 255, 'b' => wp_tinycolor_bound01($rgb_color['b'], 255) * 255);
}