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

[Vis Colors] Replace color maps with explicit OUI color palettes #4400

Open
BSFishy opened this issue Jun 26, 2023 · 0 comments
Open

[Vis Colors] Replace color maps with explicit OUI color palettes #4400

BSFishy opened this issue Jun 26, 2023 · 0 comments
Labels
next-theme OUI compliance Issues and PRs to maximize OUI usage and remove style and component hacks unified visualization UX

Comments

@BSFishy
Copy link
Contributor

BSFishy commented Jun 26, 2023

#4293 (comment)

The color palettes used in color maps could be refactored to generate the palette on demand, rather than having a static palette and choosing specific colors off of it. Most likely, the best way to do this would be to make the color maps contain a function with 1 argument, the size of the palette, and return the palette of correct size. I.e. something like

  [ColorSchemas.Blues]: {
    id: ColorSchemas.Blues,
    label: i18n.translate('charts.colormaps.bluesText', {
      defaultMessage: 'Blues',
    }),
    generate: (length) => ouiPaletteCool(length),
  },
  [ColorSchemas.YellowToRed]: {
    id: ColorSchemas.YellowToRed,
    label: i18n.translate('charts.colormaps.yellowToRedText', {
      defaultMessage: 'Yellow to Red',
    }),
    generate: (length) =>
      ouiColorPalette(
        [euiThemeVars.euiColorWarning, euiThemeVars.euiColorDanger],
        length,
        false,
        true
      ),
  },

  // etc...
@joshuarrrr joshuarrrr added unified visualization UX OUI compliance Issues and PRs to maximize OUI usage and remove style and component hacks and removed untriaged labels Jun 26, 2023
@joshuarrrr joshuarrrr changed the title Replace color maps with explicit OUI color palettes [Vis Colors] Replace color maps with explicit OUI color palettes Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next-theme OUI compliance Issues and PRs to maximize OUI usage and remove style and component hacks unified visualization UX
Projects
Status: Todo
Development

No branches or pull requests

2 participants