Here is beta v6 of the EHM Jersey Generator:
Release v1.0.0-beta.6 · archibalduk/EHM_Jersey_Generator (github.com)
I think this one is pretty much feature complete. All I have on my to-do list is to write a manual, add an application icon and add some more generic jersey combinations. Let me know if anyone has any other suggestions or bugs/issues. If not, I'll start looking at team news jersey generation.
Here is a very brief run-down of the new settings added:
Jersey Settings
Trim Colour Threshold: Determines how similar the trim colour must be to the background colour in order to change over to using the foreground colour for the jersey name and number. If any two of the RGB colour channels are within this threshold then the foreground colour will be used unless the third colour channel is sufficiently different. To calculate the difference take the "R" value of the trim and subtract it from the "R" of the background and then do the same for "G" and "B". Then see whether they are +/- within the threshold. E.g. if the Threshold is 40 and the Trim R-G-B is 20-100-50 and the Background R-G-B is 60-80-150 then this is within the Threshold as the difference between the two is 40, -20, 100 - i.e. the red and green channels are within the 40 threshold.
Text Quality: The chosen figure will be used as a multiplier when the Generator creates the name text. E.g. a setting of 2 will result in the text being created at twice its size and then shrunk down. I have set a default value of 4 (i.e. the text is created 4x the size and then shrunk down to one quarter of its size). You'll see that using a lower figure results in lower quality text. Anything above 4 doesn't seem to have any visible difference.
Character Limit Before Resize: Any name which is longer than the limit will be shrunk down in order to fit properly on the jersey. This isn't perfect but it's much better than it was. I've been trying to get word wrapping to work but I haven't had any luck so far; the text ends up partially cropped.
Batch Screen: Generic Design Settings
Generic Design Method: Allows different generic designs to be used.
The "use generic_jerseys.xlsx by team" setting is the recommended setting as this will calculate a percentage number based on the team name which it will then use to select a design from the generic_jerseys.xlsx spreadsheet.
The "use random designs by team" setting will use the percentage number based on the team name to select a trim and foreground layer but not based on the generic_jerseys.xlsx file. Given that the combinations will be random, you could end up with some very weird designs.
The "use random designs by player" setting will select completely random designs for each player. I.e. it will not create jerseys by team; it will select randomly player-by-player.
The "use a single design" setting will just use whichever single design you select in the drop-down menus below the setting.
Random Seed: This allows you to adjust what jerseys are randomly selected when using the "generic_jerseys.xlsx by team" or "random designs by team" setting. As mentioned above, these two "by team" settings result in the Generator creating a percentage/percentile figure based on a team's name. The Random Seed setting lets you adjust this upward. E.g. let's say "New York Rangers" results in a percentage of 45.2% which is represented as 0.452. Setting the Random Seed to 0.321 would result in the Rangers' figure becoming 0.452 + 0.321 = 0.773. If the seed results in a percentage beyond 100%, it will loop back to zero. E.g. 0.900 + 0.321 would result in 0.221.
Another way of looking at it is to divide 1 by the number of combinations in the generic_jerseys.xlsx spreadsheet and this will tell you by how much you would need to increase the Random Seed in order to get the next jersey design for a team. E.g. currently we have 67 combinations in that spreadsheet - so 1 / 67 = 0.015. So for every 0.015 by which you increase the Random Seed, the resulting jersey design for each team will be shifted by one.
CHANGELIST
- Added a random seed setting allowing adjustment of the randomness of generic jersey designs based on team name;
- Added batch import options: (i) enable/disable presets and team designs, (ii) random seed value (iii) varying generic jersey layer designs;
- Added text scaling, text quality and trim colour similarity settings;
- Fixed a bug which allowed invalid characters to be used in file names, resulting in a crash;
- Fixed a bug with the header row of an import spreadsheet being processed and the final row being ignored;
- Improved name text scaling when using longer names; and
- Name text now uses the foreground colour when the trim colour is similar to the background colour (both for preset and layered jerseys).