Convert HEX to RGB in PHP

if ( ! function_exists( 'hex2rgb' ) ) {
	/**
	 * hex2rgb.
	 */
	function hex2rgb( $hex ) {
		return sscanf( $hex, "#%2x%2x%2x" );
	}
}

No comments yet.

Leave a Reply