View Single Post
Old 09-29-2021, 08:05 PM   #1
chinax
Member
chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.
 
Posts: 24
Karma: 90156
Join Date: Jul 2017
Device: Nook Glowlight, Sony DPT-CP1
Thanks for Cover Generation Themes + Random Color Scheme Generator Tool

I noticed in the most recent update that we can now save our preferred Cover Generation settings as 'themes' in calibre itself, thanks to this poster/thread. I was able to copy over my pre-existing theme backups with no trouble, and am relieved not to have to do it manually anymore! It had been the most time-consuming aspect of my calibre usage.

I love to regularly refresh my color schemes, so I thought I'd post my regex templates that I paste into this site (which I meant to do a while ago anyway).

Code:
regex template for cover generation on this site: 
=====================================================
https://onlinetexttools.com/generate-text-from-regex
=====================================================

============================
ANY COLOR — IDEAL FOR BOLD/HYPERVISIBLE FONTS
============================
"#any_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]"\n\},
"#any_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]"\n\},
"#any_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]"\n\},
"#any_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]"\n\},



=================================
or 4 ANY + the 4 OPTIMIZED styles
=================================
"#any_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]"\n\},
"#any_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]"\n\},
"#any_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]"\n\},
"#any_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "contrast_color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]"\n\},
"#white_text_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]",\n "contrast_color1": "[f][6-9a-f][f][6-9a-f][f][6-9a-f]",\n "contrast_color2": "[f][6-9a-f][f][6-9a-f][f][6-9a-f]"\n\},\n
"#black_text_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]",\n "contrast_color1": "[0-3][0-9a-f][0-3][0-9a-f][0-3][0-9a-f]",\n "contrast_color2": "[0-3][0-9a-f][0-3][0-9a-f][0-3][0-9a-f]"\n\},\n 
"#light_on_dark_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-5][0-9a-f][0-5][0-9a-f][0-5][0-9a-f]",\n "color2": "[0-5][0-9a-f][0-5][0-9a-f][0-5][0-9a-f]",\n "contrast_color1": "[6-9a-f][0-9a-f][6-9a-f][0-9a-f][6-9a-f][0-9a-f]",\n "contrast_color2": "[6-9a-f][0-9a-f][6-9a-f][0-9a-f][6-9a-f][0-9a-f]"\n\},\n
"#dark_on_light_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[6-9a-f][0-9a-f][6-9a-f][0-9a-f][6-9a-f][0-9a-f]", \n "color2": "[6-9a-f][0-9a-f][6-9a-f][0-9a-f][6-9a-f][0-9a-f]", \n "contrast_color1": "[0-3][0-9a-f][0-3][0-9a-f][0-3][0-9a-f]", \n "contrast_color2": "[0-3][0-9a-f][0-3][0-9a-f][0-3][0-9a-f]"\n\},


=====================
JUST OPTIMIZED COLORS
=====================
"#white_text_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]",\n "contrast_color1": "[f][6-9a-f][f][6-9a-f][f][6-9a-f]",\n "contrast_color2": "[f][6-9a-f][f][6-9a-f][f][6-9a-f]"\n\},\n
"#black_text_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]", \n "color2": "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]",\n "contrast_color1": "[0-3][0-9a-f][0-3][0-9a-f][0-3][0-9a-f]",\n "contrast_color2": "[0-3][0-9a-f][0-3][0-9a-f][0-3][0-9a-f]"\n\},\n 
"#light_on_dark_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[0-5][0-9a-f][0-5][0-9a-f][0-5][0-9a-f]",\n "color2": "[0-5][0-9a-f][0-5][0-9a-f][0-5][0-9a-f]",\n "contrast_color1": "[6-9a-f][0-9a-f][6-9a-f][0-9a-f][6-9a-f][0-9a-f]",\n "contrast_color2": "[6-9a-f][0-9a-f][6-9a-f][0-9a-f][6-9a-f][0-9a-f]"\n\},\n
"#dark_on_light_[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]": \{\n "color1": "[6-9a-f][0-9a-f][6-9a-f][0-9a-f][6-9a-f][0-9a-f]", \n "color2": "[6-9a-f][0-9a-f][6-9a-f][0-9a-f][6-9a-f][0-9a-f]", \n "contrast_color1": "[0-3][0-9a-f][0-3][0-9a-f][0-3][0-9a-f]", \n "contrast_color2": "[0-3][0-9a-f][0-3][0-9a-f][0-3][0-9a-f]"\n\},

.
It's written to fit calibre's .json format (and have unique names), so you can paste it into your pre-existing .json files/themes. You can find them by going to: [Preferences > Miscellaneous > Open calibre configuration folder > cover-generation-themes] then open with notepad or any text editor you like.

Theoretically, you can have every possible color combination saved as a color scheme (practically, it depends on how much RAM calibre can use).

It should be clear how to paste it in without messing anything up, but obviously one should back up any file before tinkering with it.

Last edited by chinax; 09-29-2021 at 08:39 PM.
chinax is offline   Reply With Quote