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

suggestion: switch to MATLAB's chart colors #33

Open
ennerf opened this issue Feb 12, 2023 · 1 comment
Open

suggestion: switch to MATLAB's chart colors #33

ennerf opened this issue Feb 12, 2023 · 1 comment
Labels
enhancement New feature or request styles

Comments

@ennerf
Copy link
Contributor

ennerf commented Feb 12, 2023

I didn't see a reference for where the chart colors came from, but in my tests I thought that the MATLAB chart colors and dark mode version work a bit better. Here are some definitions for trying it out.

.root {

  /* default MATLAB 'colororder' */
  -color-matlab-1-light: rgb(0, 114, 189);
  -color-matlab-2-light: rgb(217, 83, 25);
  -color-matlab-3-light: rgb(237, 177, 32);
  -color-matlab-4-light: rgb(126, 47, 142);
  -color-matlab-5-light: rgb(119, 172, 48);
  -color-matlab-6-light: rgb(77, 190, 238);
  -color-matlab-7-light: rgb(162, 20, 47);

  /* from https://de.mathworks.com/matlabcentral/fileexchange/86533-dark-mode-plot */
  -color-matlab-1-dark: rgb(89, 149, 189);
  -color-matlab-2-dark: rgb(217, 115, 71);
  -color-matlab-3-dark: rgb(237, 177, 32);
  -color-matlab-4-dark: rgb(218, 81, 245);
  -color-matlab-5-dark: rgb(119, 172, 48);
  -color-matlab-6-dark: rgb(77, 190, 238);
  -color-matlab-7-dark: rgb(162, 137, 141);

  /* pick based on theme */
  -color-matlab-1: ladder(-color-bg-default, -color-matlab-1-dark 49%, -color-matlab-1-light 50%);
  -color-matlab-2: ladder(-color-bg-default, -color-matlab-2-dark 49%, -color-matlab-2-light 50%);
  -color-matlab-3: ladder(-color-bg-default, -color-matlab-3-dark 49%, -color-matlab-3-light 50%);
  -color-matlab-4: ladder(-color-bg-default, -color-matlab-4-dark 49%, -color-matlab-4-light 50%);
  -color-matlab-5: ladder(-color-bg-default, -color-matlab-5-dark 49%, -color-matlab-5-light 50%);
  -color-matlab-6: ladder(-color-bg-default, -color-matlab-6-dark 49%, -color-matlab-6-light 50%);
  -color-matlab-7: ladder(-color-bg-default, -color-matlab-7-dark 49%, -color-matlab-7-light 50%);
}
@mkpaz
Copy link
Owner

mkpaz commented Feb 12, 2023

Charts currently use the default JavaFX colors, I didn't change them. Theoretically, they should match selected theme, but it looks decent enough to my taste. Using some well-known palette for charts seems like a good idea. There are many color palettes and that's something user can easily change by overriding color variables, so I see no harm here.

image

Maybe I could include them to some extended stylesheet in the future. Seems like a good idea too. :)

@mkpaz mkpaz added the enhancement New feature or request label Feb 14, 2023
@mkpaz mkpaz added the styles label Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request styles
Projects
None yet
Development

No branches or pull requests

2 participants