Class QColor
- java.lang.Object
-
- net.sourceforge.plantuml.quantization.QColor
-
public final class QColor extends java.lang.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.
-
-
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 boolean
equals(java.lang.Object o)
static QColor
fromArgbInt(ColorMapper mapper, int rgb)
static QColor
fromRgbInt(int rgb)
static QColor
getCentroid(Multiset<QColor> colors)
double
getComponent(int index)
double
getEuclideanDistanceTo(QColor that)
QColor
getNearestColor(java.util.Collection<QColor> colors)
Find this color's nearest neighbor, based on Euclidean distance, among some set of colors.int
getRgbInt()
int
hashCode()
QColor
minus(QColor that)
QColor
plus(QColor that)
QColor
scaled(double s)
java.lang.String
toString()
-
-
-
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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-