index/src/ColourLegacy.php

26 lines
554 B
PHP

<?php
// ColourLegacy.php
// Created: 2021-09-09
// Updated: 2022-01-20
namespace Index;
class ColourLegacy extends ColourRGB {
private const INHERIT = 0x40000000;
public function shouldInherit(): bool {
return ($this->raw & self::INHERIT) > 0;
}
public function toString(): IString {
if($this->shouldInherit()) {
static $inherit = null;
if($inherit === null)
$inherit = new AString('inherit');
return $inherit;
}
return parent::toString();
}
}