Package org.sunflow.image

# Class Color

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

public final class Color extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static final Color`
`BLACK`
`static final Color`
`BLUE`
`static final Color`
`CYAN`
`static final Color`
`GRAY`
`static final Color`
`GREEN`
`static final Color`
`MAGENTA`
`static final RGBSpace`
`NATIVE_SPACE`
`static final Color`
`RED`
`static final Color`
`WHITE`
`static final Color`
`YELLOW`

## Constructor Summary

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

## Method Summary

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

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

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

## Field Details

### 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 Details

### 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 Details

### 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 String toString()

Overrides:
  `toString` in class `Object`