HEX
Server: Apache/2.4.65 (Debian)
System: Linux web6 5.10.0-36-amd64 #1 SMP Debian 5.10.244-1 (2025-09-29) x86_64
User: innocamp (1028)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/buildfft/public_html/wp-content/plugins/live-weather-station/includes/classes/CssHelper.php
<?php

namespace WeatherStation\Utilities;

use WeatherStation\Utilities\ColorsManipulation;


/**
 * Add features to pages to get options settings.
 *
 * @package Includes\Classes
 * @author Pierre Lannoy <https://pierre.lannoy.fr/>.
 * @license http://www.gnu.org/licenses/gpl-2.0.html GPLv2 or later
 * @since 3.0.0
 */
class CSS {

    /**
     * Build shadow string.
     *
     * @param string $position Position of the shadow.
     * @param string $length Position of the shadow.
     * @param string $diffusion Position of the shadow.
     * @param string $obscurity Position of the shadow.
     * @param string $color Position of the shadow.
     *
     * @return string The shadow string.
     * @since 3.7.5
     */
    public static function shadow($position, $length, $diffusion, $obscurity, $color) {
        if (strpos($position, '-') === false) {
            return '';
        }
        switch ($length) {
            case 'medium':
                $size = 3;
                break;
            case 'distant':
                $size = 6;
                break;
            case 'faraway':
                $size = 12;
                break;
            default:
                $size = 1;
        }
        switch ($diffusion) {
            case 'medium':
                $dif = 1.5;
                break;
            case 'precise':
                $dif = 3;
                break;
            default:
                $dif = 1;
        }
        switch ($obscurity) {
            case 'medium':
                $obs = 0.3;
                break;
            case 'strong':
                $obs = 0.7;
                break;
            default:
                $obs = 0.1;
        }
        $dif = (int)round($size / $dif, 0);
        $x = 0;
        $y = 0;
        $pos = explode('-', $position);
        if (count($pos) === 2) {
            switch ($pos[0]) {
                case 'top':
                    $y -= $size;
                    break;
                case 'bottom':
                    $y += $size;
                    break;
            }
            switch ($pos[1]) {
                case 'left':
                    $x -= $size;
                    break;
                case 'right':
                    $x += $size;
                    break;
            }
        }
        else {
            return '';
        }
        try {
            $c = ColorsManipulation::hexToRgb($color);
            $R = $c['R'];
            $G = $c['G'];
            $B = $c['B'];
        }
        catch (\Exception $ex) {
            $R = 0;
            $G = 0;
            $B = 0;
        }
        return $x . 'px ' . $y . 'px ' . $dif . 'px rgba(' . $R .',' . $G .',' . $B .',' . $obs . ')';
    }

}