Interface ChartTheme

All Known Implementing Classes:
BasicChartTheme

public interface ChartTheme
Chart theme interface for providing colors and fonts to renderers.

This interface defines the contract for chart theming. Implementations should be immutable to ensure thread-safety and predictable behavior during runtime theme switching.

Since:
2026-01-16
Version:
1.0.0
Author:
Arber Gashi
  • Method Details

    • getBackground

      Color getBackground()
      Gets the background color for the chart panel.
      Returns:
      The background color
    • getForeground

      Color getForeground()
      Gets the foreground color for text and lines.
      Returns:
      The foreground color
    • getGridColor

      Color getGridColor()
      Gets the grid color for axes and grid lines.
      Returns:
      The grid color
    • getAxisLabelColor

      Color getAxisLabelColor()
      Gets the color for axis labels.
      Returns:
      The axis label color
    • getAccentColor

      Color getAccentColor()
      Gets the accent color (primary highlight color).
      Returns:
      The accent color
    • getSeriesColor

      Color getSeriesColor(int index)
      Gets a series color by index.

      Implementations should cycle through available colors using modulo arithmetic to ensure a valid color is always returned.

      Parameters:
      index - The series index (0-based)
      Returns:
      The series color for the given index
    • getBaseFont

      Font getBaseFont()
      Gets the base font for chart text.
      Returns:
      The base font
    • getBullishColor

      default Color getBullishColor()
      Gets the bullish color for financial charts.

      Default implementation returns green. Override for custom financial themes.

      Returns:
      The bullish color (default: green)
    • getBearishColor

      default Color getBearishColor()
      Gets the bearish color for financial charts.

      Default implementation returns red. Override for custom financial themes.

      Returns:
      The bearish color (default: red)