Class Color8Bit

java.lang.Object
edu.wpi.first.wpilibj.util.Color8Bit

public class Color8Bit extends Object
Represents colors with 8 bits of precision.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    Blue component (0-255).
    final int
    Green component (0-255).
    final int
    Red component (0-255).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a default color (black).
    Color8Bit(int red, int green, int blue)
    Constructs a Color8Bit.
    Constructs a Color8Bit from a Color.
    Color8Bit(String hexString)
    Constructs a Color8Bit from a hex string.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
     
    int
     
    Return this color represented as a hex string.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • red

      public final int red
      Red component (0-255).
    • green

      public final int green
      Green component (0-255).
    • blue

      public final int blue
      Blue component (0-255).
  • Constructor Details

    • Color8Bit

      public Color8Bit()
      Constructs a default color (black).
    • Color8Bit

      public Color8Bit(int red, int green, int blue)
      Constructs a Color8Bit.
      Parameters:
      red - Red value (0-255)
      green - Green value (0-255)
      blue - Blue value (0-255)
    • Color8Bit

      public Color8Bit(Color color)
      Constructs a Color8Bit from a Color.
      Parameters:
      color - The color
    • Color8Bit

      public Color8Bit(String hexString)
      Constructs a Color8Bit from a hex string.
      Parameters:
      hexString - a string of the format #RRGGBB
      Throws:
      IllegalArgumentException - if the hex string is invalid.
  • Method Details