private void paintBackground(Graphics2D g, Color color, float x, int y, float width) {
   if (width <= 0
       || color == null
       || color.equals(myEditor.getColorsScheme().getDefaultBackground())
       || color.equals(myEditor.getBackgroundColor())) return;
   g.setColor(color);
   g.fillRect((int) x, y, (int) width, myView.getLineHeight());
 }
  private static Color[] toColorsForLineMarkers(Color[] baseColors) {
    final Color[] colors = new Color[baseColors.length];
    final Color tagBackground = Gray._239;
    final double transparency = 0.4;
    final double factor = 0.8;

    for (int i = 0; i < colors.length; i++) {
      final Color color = baseColors[i];

      if (color == null) {
        colors[i] = null;
        continue;
      }

      int r = (int) (color.getRed() * factor);
      int g = (int) (color.getGreen() * factor);
      int b = (int) (color.getBlue() * factor);

      r = (int) (tagBackground.getRed() * (1 - transparency) + r * transparency);
      g = (int) (tagBackground.getGreen() * (1 - transparency) + g * transparency);
      b = (int) (tagBackground.getBlue() * (1 - transparency) + b * transparency);

      colors[i] = new Color(r, g, b);
    }

    return colors;
  }
示例#3
0
 @NotNull
 public Color getSeparatorColor(@Nullable Color highlightColor) {
   if (myApplied) {
     return highlightColor == null ? Color.DARK_GRAY : highlightColor.darker();
   }
   return Color.GRAY;
 }