2 include_once(
"Services/Style/System/classes/Icons/class.ilSystemStyleIconColorSet.php");
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);
130 if(!$this->color_set){
140 $regex_for_extracting_color =
'/(?<=#)[\dabcdef]{6}/i';
144 $icon_content = file_get_contents($this->
getPath());
146 preg_match_all ($regex_for_extracting_color ,$icon_content,$color_matches);
147 if(is_array($color_matches) && is_array($color_matches[0]))
148 foreach($color_matches[0] as $color_value){
149 $numeric = strtoupper(str_replace(
"#",
"",$color_value));
169 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. ...
Create styles array
The data for the language used.
changeColors(array $color_changes)
Changes colors in the svg file of the icon and updates the icon abstraction by extracting the colors ...