Class Color

  • Direct Known Subclasses:
    HSVColor, RGBColor, YUVColor

    public class Color
    extends Object

    Class representing a color value

    Since:
    1.0
    Author:
    Christoph Praschl
    • Field Detail

      • channels

        @NonNull
        protected @lombok.NonNull double[] channels
    • Constructor Detail

      • Color

        public Color​(double... channels)
      • Color

        protected Color​(int n)
      • Color

        public Color()
    • Method Detail

      • isCompatibleWithType

        public boolean isCompatibleWithType​(ChannelType channelType)
        Checks if color is compatible with channel type
        Parameters:
        channelType - to be checked
        Returns:
        true iff compatible
      • getNumberOfChannels

        public int getNumberOfChannels()
        Returns:
        of channels of this color value
      • getChannel

        public double getChannel​(int c)
        Parameters:
        c - channel to be accessed
        Returns:
        channel value
      • getChannels

        public double[] getChannels()
        Returns:
        a copy of the color's channels
      • getChannelsShort

        public short[] getChannelsShort()
        Returns:
        a copy of the color's channels casted to short
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object