Fix rgba cast when 0 (black color)
This commit is contained in:
parent
99c33bbaf2
commit
8c0b1fbacb
1 changed files with 3 additions and 4 deletions
|
|
@ -24,10 +24,9 @@ class RgbaColor extends HtmlColor
|
|||
public function get($model, $key, $value, $attributes)
|
||||
{
|
||||
// phpcs:enable
|
||||
$intValues = collect(\str_split(\dechex(\intval($value)), 2))
|
||||
->map(function ($hex) {
|
||||
return \hexdec($hex);
|
||||
});
|
||||
$intValues = collect(\str_split($this->zeropad(\dechex(\intval($value)), 8), 2))->map(function ($hex) {
|
||||
return intval(\hexdec($hex));
|
||||
});
|
||||
// * Set Transparency as float
|
||||
$hexString = $intValues->push(\round($intValues->pop() / 100, 2))->implode(',');
|
||||
return "rgba($hexString)";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue