Conversation
This ought to now make this work correctly as the first imagemagick command invokation with a successful color generation will break the loop.
- Rename `try_gen_in_range` to `gen_colors_with_command`. - Replace hardcoded loop values with `beginning_color_count` and `iteration_count`. - Use `max_color_count` for clearer error logging logic.
- Pre-compile hex regex pattern for better performance. - Move hex extraction and validation logic from gen_colors to gen_colors_with_command. - Use list.extend() for palette concatenation. - Simplify return value to provide hex colors directly.
- Swap if/else logic to handle intermediate retries vs. final exhaustion. - Improve logging messages by including the specific magick_command used. - Change conditional check in the concatenation loop to use len(hex_colors) < 16.
- Remove unnecessary try/except block around color generation. - Return hex colors immediately upon successful generation. - Raise a RuntimeError if all ImageMagick commands fail to produce a palette. - Clean up redundant logging and flow control.
This keeps pylint and pyslp happy
That library is not used in the backend at all
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This ought to now make this work correctly as the first imagemagick command invokation with a successful color generation will break the loop.
yes the fix was this simple...
fixes #198, #205, #212 without impacting #190 and #195