public function setOpacity($opac) { $this->opacity = round(127 - 127 * ($opac / 100)); return $this; }