mkpaz / atlantafx

Modern JavaFX CSS theme collection with additional controls.
https://mkpaz.github.io/atlantafx
MIT License
847 stars 66 forks source link

suggestion: switch to MATLAB's chart colors #33

Open ennerf opened 1 year ago

ennerf commented 1 year ago

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 commented 1 year ago

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. :)