<?php
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) { exit; }
/**
 * Additional Sanitize Helpers.
 * @package WTE_Business_Card
 */
function wte_sanitize_int_range( mixed $val, int $min = 0, int $max = 100 ): int {
	$v = (int) $val;
	return max( $min, min( $max, $v ) );
}
function wte_sanitize_rgba( string $val ): string {
	if ( preg_match( '/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(,\s*[01]?\.?\d*\s*)?\)$/', $val ) ) {
		return $val;
	}
	return '';
}
