Class DamageLevelColors

java.lang.Object
megamek.client.ui.clientGUI.DamageLevelColors

public final class DamageLevelColors extends Object
Maps a unit's damage level to the colour used to show it. The board's unit label and the mini-map's damage pip both use this, so the same damage level always has the same colour.
  • Method Details

    • forEntity

      @Nullable public static Color forEntity(Entity entity)
      Parameters:
      entity - the unit to look at
      Returns:
      the colour for the unit's current damage level, or null when it is undamaged
    • forDamageLevel

      @Nullable public static Color forDamageLevel(int damageLevel)
      Parameters:
      damageLevel - one of the Entity.DMG_* constants
      Returns:
      the colour for that damage level, or null for Entity.DMG_NONE and unknown values