java.lang.Object
net.sourceforge.plantuml.quantization.QColor

public final class QColor extends Object
An RGB representation of a color, which stores each component as a double in the range [0, 1]. Values outside of [0, 1] are permitted though, as this is convenient e.g. for representing color deltas.
  • Field Details

    • BLACK

      public static final QColor BLACK
    • WHITE

      public static final QColor WHITE
    • RED

      public static final QColor RED
    • GREEN

      public static final QColor GREEN
    • BLUE

      public static final QColor BLUE
  • Constructor Details

    • QColor

      public QColor(double red, double green, double blue)
  • Method Details

    • fromArgbInt

      public static QColor fromArgbInt(ColorMapper mapper, int rgb)
    • fromRgbInt

      public static QColor fromRgbInt(int rgb)
    • getCentroid

      public static QColor getCentroid(Multiset<QColor> colors)
    • getComponent

      public double getComponent(int index)
    • scaled

      public QColor scaled(double s)
    • plus

      public QColor plus(QColor that)
    • minus

      public QColor minus(QColor that)
    • getEuclideanDistanceTo

      public double getEuclideanDistanceTo(QColor that)
    • getNearestColor

      public QColor getNearestColor(Collection<QColor> colors)
      Find this color's nearest neighbor, based on Euclidean distance, among some set of colors.
    • getRgbInt

      public int getRgbInt()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object