Source of file Colour.php
Size: 0,743 Bytes - Last Modified: 2021-12-23T10:06:29+00:00
/var/www/docs.ssmods.com/process/src/code/models/Colour.php
12345678910111213141516171819202122232425262728293031323334353637383940 | <?php class Colour extends Varchar { public function __construct($name = null, $options = array()) { parent::__construct($name, 7, $options); } public function getHash() { return substr($this->value, 1); } public function getRGB() { $hash = $this->getHash(); return array( 'R' => hexdec(substr($hash, 0, 2)), 'G' => hexdec(substr($hash, 2, 2)), 'B' => hexdec(substr($hash, 4, 2)), ); } public function getRed() { return $this->getRGB()['R']; } public function getBlue() { return $this->getRGB()['B']; } public function getGreen() { return $this->getRGB()['G']; } } |