HEX
Server: Apache
System: Linux dinesh8149 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: usesambura1 (1212012)
PHP: 7.0.33
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: /home/storage/c/63/6c/usesambura1/public_html/yr/wp-content/themes/blocksy/inc/css/colors.php
<?php

/**
 * Generate colors based on input.
 *
 * @param array $color_descriptor Colors array.
 */
if (! function_exists('blocksy_get_colors')) {
	function blocksy_get_colors( $color_descriptor, $defaults ) {
		$result = [];

		foreach ($defaults as $id => $default_data) {
			$data = $default_data;

			if (
				is_array($color_descriptor)
				&&
				isset($color_descriptor[$id])
				&&
				is_array($color_descriptor[$id])
			) {
				$data = $color_descriptor[$id];
			}

			$result[$id] = blocksy_get_color($data);
		}

		return $result;
	}
}

/**
 * Extract color from a descriptor.
 * id:
 *   - fw-custom
 *   - fw-no-color
 *   - color_skin_*
 *   - fw-inherit:location
 *   - fw-inherit:location:hover
 *   - fw-inherit:location:default
 *
 * @param array $color_descriptor Single color descriptor.
 */
if (! function_exists('blocksy_get_color')) {
	function blocksy_get_color($color_descriptor) {
		if ( ! isset( $color_descriptor['color'] ) ) {
			return null;
		}

		return $color_descriptor['color'];
	}
}

if (! function_exists('blocksy_output_colors')) {
	function blocksy_output_colors($args = []) {
		$args = wp_parse_args(
			$args,
			[
				'css' => null,
				'tablet_css' => null,
				'mobile_css' => null,
				'value' => null,
				'default' => null,
				'variables' => [],

				'desktop_selector_prefix' => '',
				'tablet_selector_prefix' => '',
				'mobile_selector_prefix' => '',

				'important' => false,
				'responsive' => false
			]
		);

		blocksy_assert_args($args, ['css', 'default']);

		if ($args['responsive']) {
			blocksy_assert_args($args, ['tablet_css', 'mobile_css']);
		}

		$responsive_value = blocksy_expand_responsive_value($args['value']);
		$responsive_default_value = blocksy_expand_responsive_value($args['default']);

		$desktop_colors = blocksy_get_colors(
			$responsive_value['desktop'],
			$responsive_default_value['desktop']
		);

		$tablet_colors = blocksy_get_colors(
			$responsive_value['tablet'],
			$responsive_default_value['tablet']
		);

		$mobile_colors = blocksy_get_colors(
			$responsive_value['mobile'],
			$responsive_default_value['mobile']
		);

		foreach ($args['variables'] as $key => $descriptor) {
			if (! isset($descriptor['selector'])) {
				$descriptor['selector'] = ':root';
			}

			$local_args = [
				'css' => $args['css'],
				'tablet_css' => $args['tablet_css'],
				'mobile_css' => $args['mobile_css'],

				'desktop_selector_prefix' => $args['desktop_selector_prefix'],
				'tablet_selector_prefix' => $args['tablet_selector_prefix'],
				'mobile_selector_prefix' => $args['mobile_selector_prefix'],

				'selector' => $descriptor['selector'],
				'variableName' => $descriptor['variable'],
				'value' => [
					'desktop' => $desktop_colors[$key],
					'tablet' => $tablet_colors[$key],
					'mobile' => $mobile_colors[$key],
				],

				'responsive' => $args['responsive']
			];

			if ($args['important']) {
				$local_args['value_suffix'] = ' !important';
			}

			blocksy_output_css_vars($local_args);
		}
	}
}