Class ContourPlot.ColorOperations

java.lang.Object
gov.nih.mipav.model.algorithms.ContourPlot.ColorOperations
Enclosing class:
ContourPlot

public static class ContourPlot.ColorOperations extends Object
The ColorOperations class contains methods for manipulating 32bit ARGB color values.
Author:
hageldave
  • Constructor Details

    • ColorOperations

      public ColorOperations()
  • Method Details

    • changeSaturation

      public static int changeSaturation(int argb, double s)
      Changes the saturation of a color.
      Parameters:
      argb - int packed argb color value
      s - saturation multilpier (1 is no change, 0 is greyscale)
      Returns:
      saturation changed color
    • interpolateColor

      public static int interpolateColor(int c1, int c2, double m)
      Linearly interpolates between the two specified colors.
      c = c1*(1-m) + c2*m
      Parameters:
      c1 - integer packed ARGB color value
      c2 - integer packed ARGB color value, e.g. 0xff00ff00 for opaque green
      m - in [0,1]
      Returns:
      interpolated color
    • scaleColorAlpha

      public static int scaleColorAlpha(int color, double m)
      Scales the alpha value of a specified integer packed ARGB color by a specified scaling factor m. New color will be (a*m, r, g, b).
      Parameters:
      color - of which alpha will be scaled
      m - scaling factor
      Returns:
      integer packed ARGB color with scaled alpha