Enum Class ColorBlindness

java.lang.Object
java.lang.Enum<ColorBlindness>
com.github.darksoulq.abyssallib.common.color.ColorBlindness
All Implemented Interfaces:
Serializable, Comparable<ColorBlindness>, Constable

public enum ColorBlindness extends Enum<ColorBlindness>
An enumeration representing various types of color vision deficiencies (CVD).

This class provides a mathematical simulation of how different colors are perceived by individuals with specific types of color blindness. The simulation process involves:

  1. Linearizing the sRGB input (Gamma expansion).
  2. Applying a transformation matrix based on the deficiency type.
  3. De-linearizing the result back to sRGB (Gamma compression).
  • Enum Constant Details

    • NORMAL

      public static final ColorBlindness NORMAL
      Standard human vision with no color deficiency.
    • PROTANOPIA

      public static final ColorBlindness PROTANOPIA
      Red-blindness; the inability to perceive red light. Resulting vision consists primarily of blues and yellows.
    • DEUTERANOPIA

      public static final ColorBlindness DEUTERANOPIA
      Green-blindness; the inability to perceive green light. This is the most common form of color blindness.
    • TRITANOPIA

      public static final ColorBlindness TRITANOPIA
      Blue-blindness; the inability to perceive blue light. A rare condition where colors are mostly seen as reds and greens.
    • ACHROMATOPSIA

      public static final ColorBlindness ACHROMATOPSIA
      Total color blindness; the inability to perceive any color. Vision is restricted to shades of gray (luminance only).
  • Method Details

    • values

      public static ColorBlindness[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ColorBlindness valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • simulate

      public org.bukkit.Color simulate(org.bukkit.Color c)
      Simulates the current color vision deficiency on a given Color.

      The method performs gamma correction before and after the color space transformation to ensure accuracy in the linear RGB space.

      Parameters:
      c - The original Color to be transformed.
      Returns:
      A new Color representing how the input would be perceived.