Consolidate methods for converting colors to/from hex strings#1626
Merged
Conversation
- Remove the `ColorBgra` hex conversion methods in favour of the ones in `Cairo.Color`. In the palette manager this was a source of conversions between ColorBgra and Cairo.Color which didn't convert between premultiplied alpha, which we want to eliminate for bug #1553. There was also no need for having duplicate logic for this in different color types - Since `ColorBgra.TohexString()` didn't produce a hex string in RGBA order, we need some simple wrappers to reorder the color channels. This preserves compatibility when loading existing settings from disk - Fix the `Cairo.Color` tests to include alpha when parsing hex strings, and add tests for converting to hex
7 tasks
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.
Remove the
ColorBgrahex conversion methods in favour of the ones inCairo.Color. In the palette manager this was a source of conversions between ColorBgra and Cairo.Color which didn't convert between premultiplied alpha, which we want to eliminate for bug Fix error-prone usage ofColorBgrawith straight vs premultiplied alpha #1553. There was also no need for having duplicate logic for this in different color typesSince
ColorBgra.TohexString()didn't produce a hex string in RGBA order, we need some simple wrappers to reorder the color channels. This preserves compatibility when loading existing settings from diskFix the
Cairo.Colortests to include alpha when parsing hex strings, and add tests for converting to hex