mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: bkni indicator
This commit is contained in:
1 parent
dc5e4fc2de
commit
5e8a69d2d8
3 files changed
+82
-12
No files matched your search
@@ -26,7 +26,7 @@ export enum BkniPercentile {
|
||||
SuperUnicum,
|
||||
}
|
||||
|
||||
const BKNI_PERCENTILES = [
|
||||
export const BKNI_PERCENTILES = [
|
||||
{ min: 0, percentile: BkniPercentile.SuperMalum },
|
||||
{ min: 10, percentile: BkniPercentile.Malum },
|
||||
{ min: 20, percentile: BkniPercentile.VeryBad },
|
||||
@@ -40,6 +40,20 @@ const BKNI_PERCENTILES = [
|
||||
{ min: 190, percentile: BkniPercentile.SuperUnicum },
|
||||
];
|
||||
|
||||
export const BKNI_COLORS = {
|
||||
[BkniPercentile.SuperMalum]: 'tomato',
|
||||
[BkniPercentile.Malum]: 'orange',
|
||||
[BkniPercentile.VeryBad]: 'amber',
|
||||
[BkniPercentile.Bad]: 'yellow',
|
||||
[BkniPercentile.BelowAverage]: 'lime',
|
||||
[BkniPercentile.Average]: 'green',
|
||||
[BkniPercentile.AboveAverage]: 'teal',
|
||||
[BkniPercentile.Good]: 'cyan',
|
||||
[BkniPercentile.VeryGood]: 'pink',
|
||||
[BkniPercentile.Unicum]: 'plum',
|
||||
[BkniPercentile.SuperUnicum]: 'purple',
|
||||
} as const;
|
||||
|
||||
export default function getBkniPercentile(wn8: number) {
|
||||
const lastIndex = BKNI_PERCENTILES.findLastIndex(({ min }) => min <= wn8);
|
||||
return BKNI_PERCENTILES[lastIndex === -1 ? 0 : lastIndex].percentile;
|
||||
|
||||
Reference in new issue
Block a user