Skip to content
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

Add Color Definitions to ColorSchema Enum (HeatMap) (from #4283) #4306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nirus2000
Copy link
Member

@Nirus2000 Nirus2000 commented Oct 25, 2024

Add Color Definitions to ColorSchema Enum

  1. GREEN_YELLOW_RED: Green for gains, Red for losses, Yellow for neutral values.
  2. GREEN_WHITE_RED: Green for gains, White for neutral, Red for losses.
  3. GREEN_RED_GREY: Green for gains, Red for losses, Grey for neutral.
  4. BLUE_ORANGE_GREY: Blue for stable values, Orange for volatile values, Grey for neutral.
  5. BLACK_YELLOW_WHITE: Black for extreme gains, Yellow for moderate returns, White for neutral.

Sorry... Reopen this... i kill my fork :-(
#4283

@Nirus2000
Copy link
Member Author

Here an example in light and dark theme

grafik

@Nirus2000 Nirus2000 force-pushed the Add-Color-Definitions-to-ColorSchema-Enum branch from 4b16faa to 6e5e0a4 Compare November 10, 2024 18:59
Updated the YELLOW_WHITE_BLACK color schema to use the default background color from the theme, similar to the existing implementation in the GREEN_WHITE_RED schema.

Add Color Definitions to ColorSchema Enum

1. **GREEN_YELLOW_RED**: Green for gains, Red for losses, Yellow for neutral values.
2. **GREEN_WHITE_RED**: Green for gains, White for neutral, Red for losses.
3. **GREEN_RED_GREY**: Green for gains, Red for losses, Grey for neutral.
4. **BLUE_ORANGE_GREY**: Blue for stable values, Orange for volatile values, Grey for neutral.
5. **BLACK_YELLOW_WHITE**: Black for extreme gains, Yellow for moderate returns, White for neutral.

The colors are obtained from colors.java

Pull Request: Refactoring of the ColorSchema Enum Class

GREEN_RED_GREY has been renamed to GREEN_GRAY_RED
BLUE_ORANGE_GREY has been renamed to BLUE_GRAY_ORANGE
BLACK_YELLOW_WHITE has been renamed to YELLOW_WHITE_BLACK.

Updating Documentation

Update GREEN_WHITE_RED Color Schema and Improve Interpolation Method

Modified the GREEN_WHITE_RED color schema to interpolate with the default background color from the theme using Colors.theme().defaultBackground().getRGB(). This change improves visual appearance in dark themes and enhances overall UI consistency.

Updated the interpolate method to clamp the factor parameter between 0 and 1. This ensures that the method handles out-of-bounds values properly, preventing unexpected results and invalid RGB values.

Enhances the color interpolation logic

GREEN_WHITE_RED
Added a transition to yellow for performance values over 0.6, improving the gradient from green to yellow.

YELLOW_WHITE_BLACK
Implemented a transition from yellow to black for values above 0.6 for better visibility of high performance.

Optimize Color Normalization and Interpolation Logic

GREEN_WHITE_RED Color Schema:
Adjusted the transition to yellow to occur earlier (from 0.6 to 0.4), allowing for a smoother gradient.
Used -p for negative performance values to ensure a proper mapping to red.

Modified GREEN_GRAY_RED Color Schema:
Incorporated the use of -p to correctly interpolate colors for negative performance values.

Refined BLUE_GRAY_ORANGE Color Schema:
Updated the interpolation for negative performance values to use -p, enhancing color representation.
@Nirus2000 Nirus2000 force-pushed the Add-Color-Definitions-to-ColorSchema-Enum branch from 8b3507a to c4def80 Compare November 10, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants