Class PaintProcessor

java.lang.Object
cz.fidentis.analyst.gui.elements.histogram.utils.PaintProcessor

public class PaintProcessor extends Object
Class for working with colors and paints.
  • Constructor Details

    • PaintProcessor

      public PaintProcessor()
  • Method Details

    • getGradientFrom

      public static Color[] getGradientFrom(Color a, Color b, int stepsCount)
      Creates a gradient from two colors.
      Parameters:
      a - color A
      b - color B
      stepsCount - how many colors will be added between color a and b (must be non-negative)
      Returns:
      gradient, the first element is color a and last element is color b
    • getColorWithAlpha

      public static Color getColorWithAlpha(Color color, int alpha)
      Creates a new Color with the same properties as the original, but with a modified alpha value.
      Parameters:
      color - source color
      alpha - desired alpha value
      Returns:
      color with desired alpha value
    • getGradientWithAlpha

      public static LinearGradientPaint getGradientWithAlpha(LinearGradientPaint gradient, int alpha)
      Creates a new LinearGradientPaint identical to the original, except for modified alpha values of the source colors.
      Parameters:
      gradient - source gradient
      alpha - desired alpha value
      Returns:
      gradient with desired alpha value
    • getColorWithSaturation

      public static Color getColorWithSaturation(Color color, float saturation)
      Creates a new Color with the same properties as the original, but with a modified saturation value.
      Parameters:
      color - source color
      saturation - desired saturation
      Returns:
      color with desired saturation
    • setGradientColors

      public void setGradientColors(Color[] colors)
      Set colors that will be used to create a gradient.
      Parameters:
      colors - gradient source colors
      See Also:
    • createHorizontalGradient

      public LinearGradientPaint createHorizontalGradient(int startX, int endX)
      Creates a LinearGradientPaint between two x values - startX and endX.
      Parameters:
      startX - startX
      endX - endX
      See Also: