Class 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.
    • Field Detail

      • 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 Detail

      • QColor

        public QColor​(double red,
                      double green,
                      double blue)
    • Method Detail

      • 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 class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object