Jump to content

Clover SVG Theme Adjuster


blackosx
 Share

7 posts in this topic

Recommended Posts

I've created a new tool to help with Clover vector themes. It's a perl script that will search and globally replace RGB hex colours in the format #000000 and replace them with new calculated RGB hex colours using the adjustments you ask for.

 

https://bitbucket.org/blackosx/cloversvgthemeadjuster

 

You can download it using:

git clone https://bitbucket.org/blackosx/cloversvgthemeadjuster.git

See the usage instructions on the README.

 

Current Version

0.0.5 (changelog)

 

Overview

The script identifies all colours in the theme file and applies adjustments to the hue, saturation and lightness before saving a new file. The adjustments can be progressively increased in a loop to generate multiple files.

 

Example:

 

Using the following commands to adjust the hue:

perl AdjustThemeColour.pl -20 0 0 10
perl AdjustThemeColour.pl +20 0 0 10

Against my original Silver theme

blue.png.a15b6414f7d18d2c73999a47438e9bcd.png

 

Can generate multiple variations and choose one I like

 

multiple.png.4a1fdf18b9ce2faf04786f1ab4e7e9e5.png

 

Say, this one...

 

green.png.a391d41828a65a0441a8879e80eccaa7.png

 

** Of course, this type of adjustment will not work on all themes. It all depends on what colours have been used in the design.

 

Or how about a de-saturated BGM_SVG?

 

bgm_desaturated.png.781c8053983f15f77ad19a69012218ad.png

 

 

Known Issues

- There's always a possibility that a newly replaced hex value may match an already existing hex value which is due to be changed afterwards. This would mean that the newly replaced colours will then be replaced incorrectly. The likely hood of this happening increases with the more colours used in the theme.

 

 

 

Edited by blackosx
Add de-saturated BGM_SVG image
  • Like 5
  • Thanks 1
Link to comment
Share on other sites

Script updated to v0.0.4

 

Changelog:

- Add InvertRgb and InvertChannel functions
- Notify any adjusted colours that match source colours
- Skip patching theme file with un-adjusted colours
- Revise stdout messages

 

EDIT:

Script updated to v0.0.5

 

- Add logging to file

- Print number of unique colours to stdout.

Edited by blackosx
  • Thanks 1
Link to comment
Share on other sites

Hi Slice

 

The script, for now, is just a generic colour changer which could work on any file containing hex values in the format of #000000. The script doesn't have any understanding of a Clover theme, a Clover theme structure or day/night concepts. All it currently does is globally search original colours and replace with adjusted colours. The only thing that currently determines what the script looks for is the filename; theme.svg.

 

I created it because of the way I make Clover SVG themes where I create individual .ai/.svg images files, some with symbols, some without, and combine them all together using my Clover SVG Theme Builder. I found I wanted to change a theme to a different colour but thought it unnecessary to go back and edit my source theme files and re-build it when nothing but the colour was changing. As it did what I wanted I thought I'd share it as it could be useful for anyone else who wants to tinker with SVG themes.

 

For now, any day/night values set in a theme will all be changed using the same adjustments. I may well look at developing the script further to have more awareness of Clover's theme concepts such as day/night but it may prove difficult to target such elements especially when symbols are used, as with BGM_SVG for example, I used the same symbols for both day and night and just included a 'night' overlay symbol on top.

 

I'm open to ideas.. :)

Link to comment
Share on other sites

 Share

×
×
  • Create New...