[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: CSS.php
<?php /******************************************************************************* * Copyright (c) 2019, Code Atlantic LLC ******************************************************************************/ class PUM_Utils_CSS { /** * @param string $hex * @param string $return_type * * @return array|string */ public static function hex2rgb( $hex = '#ffffff', $return_type = 'rgb' ) { if ( is_array( $hex ) ) { $hex = implode( '', $hex ); } $hex = str_replace( '#', '', $hex ); if ( strlen( $hex ) == 3 ) { $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) ); $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) ); $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) ); } else { $r = hexdec( substr( $hex, 0, 2 ) ); $g = hexdec( substr( $hex, 2, 2 ) ); $b = hexdec( substr( $hex, 4, 2 ) ); } $rgb = [ $r, $g, $b ]; if ( $return_type === 'array' ) { return $rgb; // returns an array with the rgb values } return 'rgb(' . implode( ',', $rgb ) . ')'; // returns the rgb values separated by commas } /** * @param string $hex * @param int $opacity * * @return string */ public static function hex2rgba( $hex = '#ffffff', $opacity = 100 ) { $rgb = self::hex2rgb( $hex, 'array' ); $opacity = number_format( intval( $opacity ) / 100, 2 ); return 'rgba( ' . implode( ', ', $rgb ) . ', ' . $opacity . ' )'; } /** * @param int $thickness * @param string $style * @param string $color * * @return string */ public static function border_style( $thickness = 1, $style = 'solid', $color = '#cccccc' ) { return "{$thickness}px {$style} {$color}"; } /** * @param int $horizontal * @param int $vertical * @param int $blur * @param int $spread * @param string $hex * @param int $opacity * @param string $inset * * @return string */ public static function box_shadow_style( $horizontal = 0, $vertical = 0, $blur = 0, $spread = 0, $hex = '#000000', $opacity = 50, $inset = 'no' ) { return "{$horizontal}px {$vertical}px {$blur}px {$spread}px " . self::hex2rgba( $hex, $opacity ) . ( $inset == 'yes' ? ' inset' : '' ); } /** * @param int $horizontal * @param int $vertical * @param int $blur * @param string $hex * @param int $opacity * * @return string */ public static function text_shadow_style( $horizontal = 0, $vertical = 0, $blur = 0, $hex = '#000000', $opacity = 50 ) { return "{$horizontal}px {$vertical}px {$blur}px " . self::hex2rgba( $hex, $opacity ); } /** * @param int|string $size * @param int|string $weight * @param float|int|string $line_height * @param string $family * @param string|null $style * @param string|null $variant * * @return mixed */ public static function font_style( $size = 16, $weight = 300, $line_height = 1.2, $family = 'Times New Roman', $style = null, $variant = null ) { $size = is_int( $size ) ? "{$size}px" : $size; $line_height = is_int( $line_height ) ? "{$line_height}px" : $line_height; return str_replace( ' ', ' ', trim( "$style $variant $weight {$size}/{$line_height} \"$family\"" ) ); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server.dijitaldukkanim.com.tr
Server IP: 104.247.168.220
PHP Version: 8.1.33
Server Software: Apache
System: Linux server.dijitaldukkanim.com.tr 4.18.0-553.105.1.el8_10.x86_64 #1 SMP Tue Feb 17 05:17:39 EST 2026 x86_64
HDD Total: 492.3 GB
HDD Free: 180.56 GB
Domains on IP: N/A (Requires external lookup)
System Features