org.opensourcephysics.display
Class DisplayColors

java.lang.Object
  extended by org.opensourcephysics.display.DisplayColors

public class DisplayColors
extends java.lang.Object

Defines color palette used by OSP components.

Version:
1.0
Author:
Wolfgang Christian

Method Summary
static java.awt.Color getLineColor(int index)
          Gets a line color that matches the index.
static java.awt.Color getMarkerColor(int index)
          Gets a marker color that matches the index.
static java.awt.Color[] getPhaseToColorArray()
          Gets an array of colors.
static java.awt.Color phaseToColor(double phi)
          Converts a phase angle in the range [-Pi,Pi] to a color.
static java.awt.Color randomColor()
          Gets a random color.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPhaseToColorArray

public static java.awt.Color[] getPhaseToColorArray()
Gets an array of colors.

Returns:
the color array

phaseToColor

public static java.awt.Color phaseToColor(double phi)
Converts a phase angle in the range [-Pi,Pi] to a color.

Parameters:
phi - phase angle
Returns:
the color

randomColor

public static java.awt.Color randomColor()
Gets a random color.

Returns:
random color

getLineColor

public static java.awt.Color getLineColor(int index)
Gets a line color that matches the index.

Parameters:
index - int
Returns:
Color

getMarkerColor

public static java.awt.Color getMarkerColor(int index)
Gets a marker color that matches the index.

Parameters:
index - int
Returns:
Color