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.
The current morphing implementation contains a dirty hack of descaling (including resetting the R,G,B values when they become larger than 255) because the method
_determine_rgb()
is called twice, once frommorph()
and a second time fromset_color()
. To prevent descaling, a part of the methodset_color()
has been separated into a private method_set_rgb()
which is called both fromset_color()
andmorph()
. This also means that the functions_remap_rgb_value_reverse()
and_remap_color_reverse()
become obsolete. Additionally, applying color inversion has been moved to method_determine_rgb()
just before applyingmax_rgb_value
. This assures that first the proper R,G,B values are determined (inverted or not) and afterwards the proper brightness is determined. With this implementation, the morphing starts nicely at the current R,G,B values and gradually transitions towards the end R,G,B values.