WP_Duotone::colord_parse( string $input ): array|null

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Tries to convert an incoming string into RGBA values.

Description

Direct port of colord’s parse function simplified for our use case. This version only supports string parsing and only returns RGBA values.

Parameters

$inputstringrequired
The string to parse.

Return

array|null An array of RGBA values or null if the string is invalid.

Source

private static function colord_parse( $input ) {
	$result = self::colord_parse_hex( $input );

	if ( ! $result ) {
		$result = self::colord_parse_rgba_string( $input );
	}

	if ( ! $result ) {
		$result = self::colord_parse_hsla_string( $input );
	}

	return $result;
}

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.