2 include_once(
"Services/Style/System/classes/Icons/class.ilSystemStyleIconColorSet.php");
59 if ($this->
getType() ==
"svg") {
60 $icon = file_get_contents($this->
getPath());
61 foreach ($color_changes as $old_color => $new_color) {
62 $icon = preg_replace(
'/' . $old_color .
'/i', $new_color, $icon, -1);
64 file_put_contents($this->
getPath(), $icon);
133 return dirname(strstr($this->
getPath(),
'global/skin'));
141 if (!$this->color_set) {
152 $regex_for_extracting_color =
'/(?<=#)[\dabcdef]{6}/i';
155 if ($this->
getType() ==
"svg") {
156 $icon_content = file_get_contents($this->
getPath());
158 preg_match_all($regex_for_extracting_color, $icon_content, $color_matches);
159 if (is_array($color_matches) && is_array($color_matches[0])) {
160 foreach ($color_matches[0] as $color_value) {
161 $numeric = strtoupper(str_replace(
"#",
"", $color_value));
183 return $this->
getColorSet()->doesColorExist($color_id);
__construct($name, $path, $type)
ilSystemStyleIcon constructor.
extractColorSet()
Extracts all colors from the icon by parsing the svg file for a regular expresion.
Abstracts an Icon and the necessary actions to get all colors out of an svg Icon. ...
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 ...