Class DiffColors

java.lang.Object
org.eclipse.compare.internal.DiffColors

public final class DiffColors extends Object
The shared color palette for diff rendering. Both the traditional two-way TextMergeViewer and the unified diff interpolate the same diff color towards the background at the same scales, so the scale factors and the interpolation live here once.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    Border / normal weight: darker and more saturated than the fill.
    static final double
    The hunk fill band; the lightest of the three.
    static final double
    The detailed (word-level) diff text background.
  • Method Summary

    Modifier and Type
    Method
    Description
    static RGB
    borderColor(RGB diffColor, RGB background)
    Border color of an addition/deletion hunk; darker than the fill band.
    static RGB
    interpolate(RGB fg, RGB bg, double scale)
    Linearly interpolates between fg and bg: scale 0 returns fg, scale 1 returns bg.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BORDER_SCALE

      public static final double BORDER_SCALE
      Border / normal weight: darker and more saturated than the fill.
      See Also:
    • TEXT_FILL_SCALE

      public static final double TEXT_FILL_SCALE
      The detailed (word-level) diff text background.
      See Also:
    • FILL_SCALE

      public static final double FILL_SCALE
      The hunk fill band; the lightest of the three.
      See Also:
  • Method Details

    • borderColor

      public static RGB borderColor(RGB diffColor, RGB background)
      Border color of an addition/deletion hunk; darker than the fill band.
    • interpolate

      public static RGB interpolate(RGB fg, RGB bg, double scale)
      Linearly interpolates between fg and bg: scale 0 returns fg, scale 1 returns bg.