WordPress at a glance
function is not described

maybe_hash_hex_color() WP 3.4.0

Ensures that any hex color is properly hashed. Otherwise, returns value untouched.

This method should only be necessary if using sanitize_hex_color_no_hash().

No Hooks.

Return

String.

Usage

maybe_hash_hex_color( $color );
$color(string) (required)

Code of maybe hash hex color: wp-includes/formatting.php VER 5.1.1

<?php
function maybe_hash_hex_color( $color ) {
	if ( $unhashed = sanitize_hex_color_no_hash( $color ) ) {
		return '#' . $unhashed;
	}

	return $color;
}