blackosx Posted January 29, 2019 Share Posted January 29, 2019 (edited) 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 Can generate multiple variations and choose one I like Say, this one... ** 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? 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 January 30, 2019 by blackosx Add de-saturated BGM_SVG image 5 1 Link to comment Share on other sites More sharing options...
Slice Posted January 29, 2019 Share Posted January 29, 2019 Does it influent gradients? Link to comment Share on other sites More sharing options...
blackosx Posted January 29, 2019 Author Share Posted January 29, 2019 Yes. It adjusts all colours. Link to comment Share on other sites More sharing options...
blackosx Posted January 29, 2019 Author Share Posted January 29, 2019 Script updated to v0.0.3 to fix incorrect RGB2HSL modulo calculation. Link to comment Share on other sites More sharing options...
blackosx Posted January 30, 2019 Author Share Posted January 30, 2019 (edited) 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 January 30, 2019 by blackosx 1 Link to comment Share on other sites More sharing options...
Slice Posted January 30, 2019 Share Posted January 30, 2019 What about day/night coloring after apply the script? Link to comment Share on other sites More sharing options...
blackosx Posted January 30, 2019 Author Share Posted January 30, 2019 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 More sharing options...
Recommended Posts