Class ColorRegistry

java.lang.Object
com.arbergashi.charts.util.ColorRegistry

public final class ColorRegistry extends Object
Flyweight cache for immutable Color instances.

Returned colors are cached and must be treated as immutable. Use this registry to avoid per-frame allocations in render loops.

  • Method Details

    • of

      public static Color of(int r, int g, int b, int a)
    • ofArgb

      public static Color ofArgb(int argb)
    • withAlpha

      public static Color withAlpha(Color base, float alpha)
    • interpolate

      public static Color interpolate(Color a, Color b, float t)
    • adjustBrightness

      public static Color adjustBrightness(Color c, double factor)