Repository navigation
Fix plane steps, custom-space restoration and gamut hue wrapping - #368
Merged
Merged
Conversation
equals compares the coordinates with ==, which takes 0.0 and -0.0 as equal, but hashCode hashed their bits, so two equal primaries could miss each other as map keys. A primary on x = 0, as ACES AP0's green is, makes the sign reachable from ordinary arithmetic.
maxChroma and cusp multiplied the hue by pi before any reduction, so Double.MAX_VALUE overflowed to infinity and answered NaN, and a hue such as 1e20 was rounded to a different angle from the one a ColorValue of that hue stores. They now wrap it with the function ColorValue uses.
A controlled picker keeps an incoming value in the caller's space, but its saver knew only the library's spaces and the picker's own. A value in any other space did not restore, so the state was rebuilt after recreation and a grey came back at hue 0 rather than the hue it had been dragged from.
The plane stepped from the values of its last composition. Screen-reader actions taken before the caller's update recomposed it each started from the old position, so a step on one axis undid the step just taken on the other: right, up, right from the centre ended with x one step short. The plane now builds on the step it reported until composition answers, as BasicColorSlider does. Steps also start from the position drawn rather than the raw value, which puts an out-of-range value at the edge and NaN at 0. A NaN x stayed NaN whatever key was pressed.
A redundant cast, a missing opt-in for runCurrent, and ThreadLocal.get()'s nullable platform type, which Kotlin 2.4 reports as a Java type mismatch. All three printed on every build.
CSS Color 4 section 14.2 now allows three gamut-mapping algorithms. The library's Css is the binary search with local MINDE, which returns a clipped color within a just-noticeable difference, so lightness and hue move by up to that; ChromaReduction is the one that keeps them to rounding. The CMYK KDoc called the model reversible, but many CMYK values give one RGB, and an RGB color whose highest channel is exactly 0 with another below it is singular. README said the gallery images are the screenshot references CI checks, while they are copies it never compares; that HSV is a CSS formula, which CSS does not define; that planes are built off the main thread on the web, which has one thread; and that 1.2.1 is the latest release, which Maven Central does not have. It gains a requirements section, the saveable state in the Quick Start, and the classpath clash between 1.x and 2.x, which both ship codes.side.colorpicker.state.ColorPickerState.
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.
Builds on #367.
Defects, each with a test that fails on
dd4b25e:RgbGamut.maxChromaandcuspwrap the hue first, asColorValuedoes.Double.MAX_VALUEanswered NaN, and a hue such as 1e20 was taken as a different angle.RgbPrimarieshash alike when a coordinate is-0.0.Docs:
Cssis the binary search with local MINDE, which holds lightness and hue to within a just-noticeable difference, andChromaReductionholds them to rounding. README and theGamutMappingKDoc say which is which.Also clears three compiler warnings.
apiCheckand the 30 screenshot baselines pass.