import { Color } from '../../../../common/colors' ; import { SeriesKey } from '../../../../common/series_id' ; import { GlobalChartState } from '../../../../state/chart_state' ; import { createCustomCachedSelector } from '../../../../state/create_selector' ; import { getChartThemeSelector } from '../../../../state/selectors/get_chart_theme' ; import { getSeriesColors } from '../../utils/series' ; import { getCustomSeriesColors } from '../utils/utils' ; import { computeSeriesDomainsSelector } from './compute_series_domains' ; function getColorOverrides ( { colors } ) { return colors ; } internal export const getSeriesColorsSelector = createCustomCachedSelector ( [ computeSeriesDomainsSelector , getChartThemeSelector , getColorOverrides ] , ( seriesDomainsAndData , chartTheme , colorOverrides ) : Map < SeriesKey , Color > => { const updatedCustomSeriesColors = getCustomSeriesColors ( seriesDomainsAndData . formattedDataSeries ) ; return getSeriesColors ( seriesDomainsAndData . formattedDataSeries , chartTheme . colors , updatedCustomSeriesColors , colorOverrides ) ; } ) ;