Skip to content

Commit beb8f6d

Browse files
committed
feat: use green color as default for versions
1 parent 88f224d commit beb8f6d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/utils/clusterVersionColors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import uniqBy from 'lodash/uniqBy';
33
import type {MetaClusterVersion} from '../types/api/meta';
44
import type {VersionToColorMap} from '../types/versions';
55

6-
import {COLORS, GREY_COLOR, getMinorVersion, hashCode} from './versions';
6+
import {COLORS, DEFAULT_COLOR, getMinorVersion, hashCode} from './versions';
77

88
const UNDEFINED_COLOR_INDEX = '__no_color__';
99

@@ -35,7 +35,7 @@ export const getVersionColors = (versionMap: VersionsMap) => {
3535
.sort((a, b) => hashCode(b) - hashCode(a))
3636
.forEach((minor, minorIndex) => {
3737
if (baseColorIndex === UNDEFINED_COLOR_INDEX) {
38-
versionToColor.set(minor, GREY_COLOR);
38+
versionToColor.set(minor, DEFAULT_COLOR);
3939
} else {
4040
// baseColorIndex is numeric as we check if it is UNDEFINED_COLOR_INDEX before
4141
const currentColorIndex = Number(baseColorIndex) % COLORS.length;

src/utils/versions/getVersionsColors.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const hashCode = (s: string) => {
1212
// TODO: colors used in charts as well, need to move to constants
1313
// 11 distinct colors from https://mokole.com/palette.html
1414
export const COLORS = [
15-
'#008000', // green
1615
'#4169e1', // royalblue
1716
'#ffd700', // gold
1817
'#ff8c00', // darkorange
@@ -25,7 +24,7 @@ export const COLORS = [
2524
'#b22222', // firebrick
2625
];
2726

28-
export const GREY_COLOR = '#bfbfbf';
27+
export const DEFAULT_COLOR = '#008000'; // green
2928

3029
export const getVersionsMap = (versions: string[], initialMap: VersionsMap = new Map()) => {
3130
versions.forEach((version) => {
@@ -88,7 +87,7 @@ export const getVersionToColorMap = (versionsMap: VersionsMap) => {
8887
versionToColor.set(minor.version, versionColor);
8988
});
9089
} else {
91-
versionToColor.set(item.version, GREY_COLOR);
90+
versionToColor.set(item.version, DEFAULT_COLOR);
9291
}
9392
});
9493
return versionToColor;

0 commit comments

Comments
 (0)