-
Notifications
You must be signed in to change notification settings - Fork 159
UIEXT-1663: Adapt color model range to work with color gradient designer #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
UIEXT-1663: Adapt color model range to work with color gradient designer #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements a Color Gradient Designer feature for the KNIME Color Manager, enabling support for:
- Multiple stop values/colors with CIELab color space interpolation
- Predefined color gradients (matplotlib/ColorBrewer palettes)
- Special color handling for edge cases (NaN, infinity, missing values)
- Percentage-based and absolute value stop configurations
Key changes:
- New color space conversion utilities for sRGB/Hex/CIELab transformations
- Enhanced ColorModelRange to support gradient-based color models
- Predefined color gradient definitions from matplotlib and ColorBrewer
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ColorSpaceConversionUtil.java | Utility class for color space conversions between sRGB, Hex, and CIELab |
| ColorModelRange.java | Extended to support multiple stop values, special colors, and gradient-based interpolation |
| ColorGradientDefinitionUtil.java | Constant definitions for predefined color gradients from matplotlib and ColorBrewer |
| ColorGradient.java | Enum defining available color gradient options |
| ColorSpaceConversionUtilTest.java | Test coverage for color space conversion utilities |
| ColorModelRangeTest.java | Expanded test coverage for new ColorModelRange functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
org.knime.core/src/eclipse/org/knime/core/data/property/ColorModelRange.java
Outdated
Show resolved
Hide resolved
org.knime.core/src/eclipse/org/knime/core/data/property/ColorModelRange.java
Outdated
Show resolved
Hide resolved
| config.addDoubleArray(CFG_STOP_VALUES, m_stopValues); | ||
| config.addStringArray(CFG_STOP_COLORS_HEX, Arrays.stream(m_stopColorsCIELab) | ||
| .map(ColorSpaceConversionUtil::convertCIELabColorToHexString).toArray(String[]::new)); | ||
| } else if (!m_stopValuesArePercentages) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this case even exist? I.e. a non-custom color gradient that is not percentage?
I think it is even not possible to construct such a case given the current constructors since either CUSTOM is used or stopValuesArePercentages is set to true.
So let's remove this if thats the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,
- Percentage Non-Custom: Gradient Designer without input port and cividis
- Absolute Non Custom: Gradient Designer with input port and cividis (here, the color model gets applied to the common domain)
org.knime.core/src/eclipse/org/knime/core/data/property/ColorModelRange.java
Outdated
Show resolved
Hide resolved
| } | ||
| if (gradient != ColorGradient.CUSTOM) { | ||
| var colorModel = new ColorModelRange(specialColors, gradient); | ||
| if (!stopValuesArePercentages) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here: This cannot happen, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
org.knime.core/src/eclipse/org/knime/core/data/property/ColorModelRange.java
Outdated
Show resolved
Hide resolved
org.knime.core/src/eclipse/org/knime/core/data/property/ColorModelRange.java
Outdated
Show resolved
Hide resolved
org.knime.core/src/eclipse/org/knime/core/data/property/ColorModelRange.java
Outdated
Show resolved
Hide resolved
- Add support for special colors - Add support for predefined gradients - Add support for custom gradients with multiple stop values/colors - Add possibility to apply model (similar to model nominal) - Add color conversion utility - Interpolate using lab for new models/use rgb interpolation for color manager UIEXT-1663 (Web UI for Color Manager - Color Gradient Designer)
- constuctor for predefined gradients should not be used for custom gradients - applied models should not be applied a second time UIEXT-1663 (Web UI for Color Manager - Color Gradient Designer)
UIEXT-1663 (Web UI for Color Manager - Color Gradient Designer)
08646a9 to
de1907a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
org.knime.core/src/eclipse/org/knime/core/data/property/ColorModelRange2.java:1
- Corrected spelling of 'testThrowsWhenStopValuesAreNotSortedNonDecreasing'. The word 'Descreasing' should be 'Decreasing'.
/*
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|




UIEXT-1663 (Web UI for Color Manager - Color Gradient Designer)