org.sunflow.image

## Class Color

- java.lang.Object
- - org.sunflow.image.Color

    public final class Color
    extends java.lang.Object

### Field Summary

Fields
`static Color` `BLACK`
`static Color` `BLUE`
`static Color` `CYAN`
`static Color` `GRAY`
`static Color` `GREEN`
`static Color` `MAGENTA`
`static RGBSpace` `NATIVE_SPACE`
`static Color` `RED`
`static Color` `WHITE`
`static Color` `YELLOW`

### Constructor Summary

Constructors
Constructor and Description
`Color()`
`Color(Color c)`
`Color(float gray)`
`Color(float r, float g, float b)`
`Color(int rgb)`

### Method Summary

Methods
`Color` `add(Color c)`
`static Color` `add(Color c1, Color c2)`
`static Color` `add(Color c1, Color c2, Color dest)`
`static Color` `black()`
`static Color` `blend(Color c1, Color c2, Color b)`
`static Color` `blend(Color c1, Color c2, Color b, Color dest)`
`static Color` `blend(Color c1, Color c2, float b)`
`static Color` `blend(Color c1, Color c2, float b, Color dest)`
`Color` `clamp(float min, float max)`
`Color` `constrainRGB()`
`Color` `copy()`
`Color` `div(Color c)`
`static Color` `div(Color c1, Color c2)`
`static Color` `div(Color c1, Color c2, Color dest)`
`Color` `exp()`
`float` `getAverage()`
`float` `getLuminance()`
`float` `getMax()`
`float` `getMin()`
`float[]` `getRGB()`
`static boolean` `hasContrast(Color c1, Color c2, float thresh)`
`boolean` `isBlack()`
`boolean` `isInf()`
`boolean` `isNan()`
`boolean` `isWhite()`
`Color` `madd(Color s, Color c)`
`Color` `madd(float s, Color c)`
`Color` `mul(Color c)`
`static Color` `mul(Color c1, Color c2)`
`static Color` `mul(Color c1, Color c2, Color dest)`
`Color` `mul(float s)`
`static Color` `mul(float s, Color c)`
`static Color` `mul(float s, Color c, Color dest)`
`Color` `opposite()`
`Color` `set(Color c)`
`Color` `set(float r, float g, float b)`
`Color` `setRGB(int rgb)`
`Color` `setRGBE(int rgbe)`
`Color` `sub(Color c)`
`static Color` `sub(Color c1, Color c2)`
`static Color` `sub(Color c1, Color c2, Color dest)`
`Color` `toLinear()`
`Color` `toNonLinear()`
`int` `toRGB()`
`int` `toRGBA(float a)`
`int` `toRGBE()`
`java.lang.String` `toString()`
`static Color` `white()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### NATIVE_SPACE

    public static final RGBSpace NATIVE_SPACE

#### BLACK

    public static final Color BLACK

#### WHITE

    public static final Color WHITE

#### RED

    public static final Color RED

#### GREEN

    public static final Color GREEN

#### BLUE

    public static final Color BLUE

#### YELLOW

    public static final Color YELLOW

#### CYAN

    public static final Color CYAN

#### MAGENTA

    public static final Color MAGENTA

#### GRAY

    public static final Color GRAY

### Constructor Detail

#### Color

    public Color()

#### Color

    public Color(float gray)

#### Color

    public Color(float r,
         float g,
         float b)

#### Color

    public Color(Color c)

#### Color

    public Color(int rgb)

### Method Detail

#### black

    public static Color black()

#### white

    public static Color white()

#### toNonLinear

    public Color toNonLinear()

#### toLinear

    public Color toLinear()

#### copy

    public Color copy()

#### set

    public final Color set(float r,
            float g,
            float b)

#### set

    public final Color set(Color c)

#### setRGB

    public final Color setRGB(int rgb)

#### setRGBE

    public final Color setRGBE(int rgbe)

#### isBlack

    public final boolean isBlack()

#### isWhite

    public boolean isWhite()

#### getLuminance

    public final float getLuminance()

#### getMin

    public final float getMin()

#### getMax

    public final float getMax()

#### getAverage

    public final float getAverage()

#### getRGB

    public final float[] getRGB()

#### toRGB

    public final int toRGB()

#### toRGBA

    public final int toRGBA(float a)

#### toRGBE

    public final int toRGBE()

#### constrainRGB

    public final Color constrainRGB()

#### isNan

    public final boolean isNan()

#### isInf

    public final boolean isInf()

#### add

    public final Color add(Color c)

#### add

    public static final Color add(Color c1,
            Color c2)

#### add

    public static final Color add(Color c1,
            Color c2,
            Color dest)

#### madd

    public final Color madd(float s,
             Color c)

#### madd

    public final Color madd(Color s,
             Color c)

#### sub

    public final Color sub(Color c)

#### sub

    public static final Color sub(Color c1,
            Color c2)

#### sub

    public static final Color sub(Color c1,
            Color c2,
            Color dest)

#### mul

    public final Color mul(Color c)

#### mul

    public static final Color mul(Color c1,
            Color c2)

#### mul

    public static final Color mul(Color c1,
            Color c2,
            Color dest)

#### mul

    public final Color mul(float s)

#### mul

    public static final Color mul(float s,
            Color c)

#### mul

    public static final Color mul(float s,
            Color c,
            Color dest)

#### div

    public final Color div(Color c)

#### div

    public static final Color div(Color c1,
            Color c2)

#### div

    public static final Color div(Color c1,
            Color c2,
            Color dest)

#### exp

    public final Color exp()

#### opposite

    public final Color opposite()

#### clamp

    public final Color clamp(float min,
              float max)

#### blend

    public static final Color blend(Color c1,
              Color c2,
              float b)

#### blend

    public static final Color blend(Color c1,
              Color c2,
              float b,
              Color dest)

#### blend

    public static final Color blend(Color c1,
              Color c2,
              Color b)

#### blend

    public static final Color blend(Color c1,
              Color c2,
              Color b,
              Color dest)

#### hasContrast

    public static final boolean hasContrast(Color c1,
                      Color c2,
                      float thresh)

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`