5180 fichiers 38.5 Mo 0 téléchargements 185 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / api / navigator / NavigatorUserCountColor.ts
NavigatorUserCountColor.ts 822 o Télécharger le fichier
/**
 * Habbo AIR `class_3949.getUserCountColor` (WIN63 new navigator occupancy chip).
 * 0xFFC2332C / 0xFFFFB11B / 0xFF63B162 / 0xFFCBCAC1.
 */
export const NAVIGATOR_USERCOUNT_RED = '#C2332C';
export const NAVIGATOR_USERCOUNT_YELLOW = '#FFB11B';
export const NAVIGATOR_USERCOUNT_GREEN = '#63B162';
export const NAVIGATOR_USERCOUNT_EMPTY = '#CBCAC1';

export const getNavigatorUserCountColor = (userCount: number, maxUserCount: number): string => {
    if (maxUserCount <= 0) return userCount > 0 ? NAVIGATOR_USERCOUNT_GREEN : NAVIGATOR_USERCOUNT_EMPTY;

    const percent = 100 * (userCount / maxUserCount);

    if (percent >= 92) return NAVIGATOR_USERCOUNT_RED;
    if (percent >= 50) return NAVIGATOR_USERCOUNT_YELLOW;
    if (userCount > 0) return NAVIGATOR_USERCOUNT_GREEN;

    return NAVIGATOR_USERCOUNT_EMPTY;
};
15Sujets
1Dépôts
20Membres
2En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser