You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
936 B
45 lines
936 B
export const gradeColors = [
|
|
"#990000",
|
|
"#C23D13",
|
|
"#C27C13",
|
|
"#C2B113",
|
|
"#D3D715",
|
|
"#A0CF1C",
|
|
"#3A9918"
|
|
];
|
|
|
|
export const gradeNames = [
|
|
"To reject",
|
|
"Insufficient",
|
|
"Passable",
|
|
"Fair",
|
|
"Good",
|
|
"Very good",
|
|
"Excellent"
|
|
];
|
|
|
|
export const gradeClass = [
|
|
"to-reject",
|
|
"insufficient",
|
|
"passable",
|
|
"fair",
|
|
"good",
|
|
"very-good",
|
|
"excellent"
|
|
];
|
|
|
|
export const gradeValues = [0, 1, 2, 3, 4, 5, 6, 7];
|
|
|
|
export const getGradeColor = (gradeIdx: number, numGrades: number): string => {
|
|
const extraColors = gradeColors.length - numGrades;
|
|
if (extraColors < 0) {
|
|
throw Error("More grades than available colors");
|
|
}
|
|
const startIndex = Math.floor(extraColors / 2);
|
|
const colors = gradeColors.slice(startIndex, gradeColors.length - (extraColors - startIndex));
|
|
if (colors.length < numGrades) {
|
|
throw Error("Issue with the number of colors");
|
|
}
|
|
return colors[colors.length - gradeIdx - 1]
|
|
}
|