Class DisplayColors

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

public class DisplayColors extends Object
Defines color palette used by OSP components.
Version:
1.0
Author:
Wolfgang Christian
  • Method Details

    • getPhaseToColorArray

      public static Color[] getPhaseToColorArray()
      Gets an array of colors.
      Returns:
      the color array
    • phaseToColor

      public static 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 Color randomColor()
      Gets a random color.
      Returns:
      random color
    • getLineColor

      public static Color getLineColor(int index)
      Gets a line color that matches the index.
      Parameters:
      index - int
      Returns:
      Color
    • getMarkerColor

      public static Color getMarkerColor(int index)
      Gets a marker color that matches the index.
      Parameters:
      index - int
      Returns:
      Color