Class QColor
- java.lang.Object
-
- net.sourceforge.plantuml.quantization.QColor
-
public final class QColor extends java.lang.ObjectAn 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.
-
-
Constructor Summary
Constructors Constructor Description QColor(double red, double green, double blue)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)static QColorfromArgbInt(ColorMapper mapper, int rgb)static QColorfromRgbInt(int rgb)static QColorgetCentroid(Multiset<QColor> colors)doublegetComponent(int index)doublegetEuclideanDistanceTo(QColor that)QColorgetNearestColor(java.util.Collection<QColor> colors)Find this color's nearest neighbor, based on Euclidean distance, among some set of colors.intgetRgbInt()inthashCode()QColorminus(QColor that)QColorplus(QColor that)QColorscaled(double s)java.lang.StringtoString()
-
-
-
Method Detail
-
fromArgbInt
public static QColor fromArgbInt(ColorMapper mapper, int rgb)
-
fromRgbInt
public static QColor fromRgbInt(int rgb)
-
getComponent
public double getComponent(int index)
-
scaled
public QColor scaled(double s)
-
getEuclideanDistanceTo
public double getEuclideanDistanceTo(QColor that)
-
getNearestColor
public QColor getNearestColor(java.util.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(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-