19 declare(strict_types=1);
    46     public function __construct(
string $name, 
string $path, 
string $type)
    58         if ($this->
getType() == 
'svg') {
    59             $icon = file_get_contents($this->
getPath());
    60             foreach ($color_changes as $old_color => $new_color) {
    61                 $icon = preg_replace(
'/#' . $old_color . 
'/i', 
'#' . $new_color, $icon, -1);
    63             file_put_contents($this->
getPath(), $icon);
    73     public function setType(
string $type): void
    83     public function setName(
string $name): void
    98     public function setPath(
string $path): void
   109         $path = strstr($this->
getPath(), 
'global/skin');
   113         return dirname($path);
   118         if (!isset($this->color_set)) {
   129         $regex_for_extracting_color = 
'/((?<=#)[\dabcdef]{6})|((?<=#)[\dabcdef]{3})/i';
   132         if ($this->
getType() == 
'svg') {
   133             $icon_content = file_get_contents($this->
getPath());
   135             preg_match_all($regex_for_extracting_color, $icon_content, $color_matches);
   136             if (is_array($color_matches) && is_array($color_matches[0])) {
   137                 foreach ($color_matches[0] as $color_value) {
   138                     $numeric = strtoupper(str_replace(
'#', 
'', $color_value));
   153         return $this->
getColorSet()->doesColorExist($color_id);
 setColorSet(ilSystemStyleIconColorSet $color_set)
 
string $name
Name of the Icon. 
 
extractColorSet()
Extracts all colors from the icon by parsing the svg file for a regular expresion. 
 
ilSystemStyleIconColorSet $color_set
Color set extracted from the icon. 
 
Abstracts an Icon and the necessary actions to get all colors out of an svg Icon. ...
 
string $path
Path to the icon including name and extension. 
 
getDirRelToCustomizing()
Only get dir rel to the Customizing dir without name and extension from. 
 
changeColors(array $color_changes)
Changes colors in the svg file of the icon and updates the icon abstraction by extracting the colors ...
 
__construct(string $name, string $path, string $type)
 
string $type
Extension of the icon. 
 
usesColor(string $color_id)