// Path: src/com/bulenkov/iconloader/IsRetina.java
// public class IsRetina {
//   public static boolean isRetina() {
//     try {
//       final Ref<Boolean> isRetina = Ref.create(false);
// 
//       new CImage.HiDPIScaledImage(1, 1, BufferedImage.TYPE_INT_ARGB) {
//         @Override
//         public void drawIntoImage(BufferedImage image, float v) {
//           isRetina.set(v > 1);
//         }
//       };
// 
//       return isRetina.get();
//     } catch (Throwable ignore) {
//       return false;
//     }
//   }
// }
// 
// Path: src/com/bulenkov/iconloader/JBHiDPIScaledImage.java
// public class JBHiDPIScaledImage extends BufferedImage {
//   private final Image myImage;
// 
//   public JBHiDPIScaledImage(int width, int height, int type) {
//     this(null, 2 * width, 2 * height, type);
//   }
// 
//   public JBHiDPIScaledImage(Image image, int width, int height, int type) {
//     super(width, height, type);
//     myImage = image;
//   }
// 
//   public Image getDelegate() {
//     return myImage;
//   }
// 
//   @Override
//   public Graphics2D createGraphics() {
//     final Graphics2D g = super.createGraphics();
// 
//     if (myImage == null) {
//       return new HiDPIScaledGraphics(g, this);
//     }
// 
//     return g;
//   }
// }
// 
// Path: src/com/bulenkov/iconloader/RetinaImage.java
// public class RetinaImage {
// 
//   /**
//    * Creates a Retina-aware wrapper over a raw image.
//    * The raw image should be provided in scale of the Retina default scale factor (2x).
//    * The wrapper will represent the raw image in the user coordinate space.
//    *
//    * @param image the raw image
//    * @return the Retina-aware wrapper
//    */
//   public static Image createFrom(Image image) {
//     return createFrom(image, 2, IconLoader.ourComponent);
//   }
// 
//   /**
//    * Creates a Retina-aware wrapper over a raw image.
//    * The raw image should be provided in the specified scale.
//    * The wrapper will represent the raw image in the user coordinate space.
//    *
//    * @param image the raw image
//    * @param scale the raw image scale
//    * @param observer the raw image observer
//    * @return the Retina-aware wrapper
//    */
//   public static Image createFrom(Image image, final int scale, ImageObserver observer) {
//     int w = image.getWidth(observer);
//     int h = image.getHeight(observer);
// 
//     Image hidpi = create(image, w / scale, h / scale, BufferedImage.TYPE_INT_ARGB);
//     if (SystemInfo.isAppleJvm) {
//       Graphics2D g = (Graphics2D)hidpi.getGraphics();
//       g.scale(1f / scale, 1f / scale);
//       g.drawImage(image, 0, 0, null);
//       g.dispose();
//     }
// 
//     return hidpi;
//   }
// 
//   public static BufferedImage create(final int width, int height, int type) {
//     return create(null, width, height, type);
//   }
// 
// 
//   private static BufferedImage create(Image image, final int width, int height, int type) {
//     if (SystemInfo.isAppleJvm) {
//       return AppleHiDPIScaledImage.create(width, height, type);
//     } else {
//       if (image == null) {
//         return new JBHiDPIScaledImage(width, height, type);
//       } else {
//         return new JBHiDPIScaledImage(image, width, height, type);
//       }
//     }
//   }
// 
//   public static boolean isAppleHiDPIScaledImage(Image image) {
//     return UIUtil.isAppleRetina() && AppleHiDPIScaledImage.is(image);
//   }
// }


import com.bulenkov.iconloader.IsRetina;
import com.bulenkov.iconloader.JBHiDPIScaledImage;
import com.bulenkov.iconloader.RetinaImage;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.lang.reflect.Field;
    return UIManager.getColor("Tree.foreground");
  }

  private static final Color DECORATED_ROW_BG_COLOR = new DoubleColor(new Color(242, 245, 249), new Color(65, 69, 71));

  public static Color getDecoratedRowColor() {
    return DECORATED_ROW_BG_COLOR;
  }

  public static Color getTreeSelectionBackground(boolean focused) {
    return focused ? getTreeSelectionBackground() : getTreeUnfocusedSelectionBackground();
  }

  private static Color getTreeSelectionBackground() {
    return UIManager.getColor("Tree.selectionBackground");
  }

  public static Color getTreeUnfocusedSelectionBackground() {
    Color background = getTreeTextBackground();
    return ColorUtil.isDark(background) ? new DoubleColor(Gray._30, new Color(13, 41, 62)) : Gray._212;
  }

  public static Color getTreeTextBackground() {
    return UIManager.getColor("Tree.textBackground");
  }

  public static void drawImage(Graphics g, Image image, int x, int y, ImageObserver observer) {
    if (image instanceof JBHiDPIScaledImage) {
      final Graphics2D newG = (Graphics2D) g.create(x, y, image.getWidth(observer), image.getHeight(observer));
      newG.scale(0.5, 0.5);
// Path: src/com/bulenkov/iconloader/IsRetina.java
// public class IsRetina {
//   public static boolean isRetina() {
//     try {
//       final Ref<Boolean> isRetina = Ref.create(false);
// 
//       new CImage.HiDPIScaledImage(1, 1, BufferedImage.TYPE_INT_ARGB) {
//         @Override
//         public void drawIntoImage(BufferedImage image, float v) {
//           isRetina.set(v > 1);
//         }
//       };
// 
//       return isRetina.get();
//     } catch (Throwable ignore) {
//       return false;
//     }
//   }
// }
// 
// Path: src/com/bulenkov/iconloader/JBHiDPIScaledImage.java
// public class JBHiDPIScaledImage extends BufferedImage {
//   private final Image myImage;
// 
//   public JBHiDPIScaledImage(int width, int height, int type) {
//     this(null, 2 * width, 2 * height, type);
//   }
// 
//   public JBHiDPIScaledImage(Image image, int width, int height, int type) {
//     super(width, height, type);
//     myImage = image;
//   }
// 
//   public Image getDelegate() {
//     return myImage;
//   }
// 
//   @Override
//   public Graphics2D createGraphics() {
//     final Graphics2D g = super.createGraphics();
// 
//     if (myImage == null) {
//       return new HiDPIScaledGraphics(g, this);
//     }
// 
//     return g;
//   }
// }
// 
// Path: src/com/bulenkov/iconloader/RetinaImage.java
// public class RetinaImage {
// 
//   /**
//    * Creates a Retina-aware wrapper over a raw image.
//    * The raw image should be provided in scale of the Retina default scale factor (2x).
//    * The wrapper will represent the raw image in the user coordinate space.
//    *
//    * @param image the raw image
//    * @return the Retina-aware wrapper
//    */
//   public static Image createFrom(Image image) {
//     return createFrom(image, 2, IconLoader.ourComponent);
//   }
// 
//   /**
//    * Creates a Retina-aware wrapper over a raw image.
//    * The raw image should be provided in the specified scale.
//    * The wrapper will represent the raw image in the user coordinate space.
//    *
//    * @param image the raw image
//    * @param scale the raw image scale
//    * @param observer the raw image observer
//    * @return the Retina-aware wrapper
//    */
//   public static Image createFrom(Image image, final int scale, ImageObserver observer) {
//     int w = image.getWidth(observer);
//     int h = image.getHeight(observer);
// 
//     Image hidpi = create(image, w / scale, h / scale, BufferedImage.TYPE_INT_ARGB);
//     if (SystemInfo.isAppleJvm) {
//       Graphics2D g = (Graphics2D)hidpi.getGraphics();
//       g.scale(1f / scale, 1f / scale);
//       g.drawImage(image, 0, 0, null);
//       g.dispose();
//     }
// 
//     return hidpi;
//   }
// 
//   public static BufferedImage create(final int width, int height, int type) {
//     return create(null, width, height, type);
//   }
// 
// 
//   private static BufferedImage create(Image image, final int width, int height, int type) {
//     if (SystemInfo.isAppleJvm) {
//       return AppleHiDPIScaledImage.create(width, height, type);
//     } else {
//       if (image == null) {
//         return new JBHiDPIScaledImage(width, height, type);
//       } else {
//         return new JBHiDPIScaledImage(image, width, height, type);
//       }
//     }
//   }
// 
//   public static boolean isAppleHiDPIScaledImage(Image image) {
//     return UIUtil.isAppleRetina() && AppleHiDPIScaledImage.is(image);
//   }
// }


// Path: src/com/bulenkov/iconloader/util/UIUtil.java
import com.bulenkov.iconloader.IsRetina;
import com.bulenkov.iconloader.JBHiDPIScaledImage;
import com.bulenkov.iconloader.RetinaImage;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.lang.reflect.Field;

    return UIManager.getColor("Tree.foreground");
  }

  private static final Color DECORATED_ROW_BG_COLOR = new DoubleColor(new Color(242, 245, 249), new Color(65, 69, 71));

  public static Color getDecoratedRowColor() {
    return DECORATED_ROW_BG_COLOR;
  }

  public static Color getTreeSelectionBackground(boolean focused) {
    return focused ? getTreeSelectionBackground() : getTreeUnfocusedSelectionBackground();
  }

  private static Color getTreeSelectionBackground() {
    return UIManager.getColor("Tree.selectionBackground");
  }

  public static Color getTreeUnfocusedSelectionBackground() {
    Color background = getTreeTextBackground();
    return ColorUtil.isDark(background) ? new DoubleColor(Gray._30, new Color(13, 41, 62)) : Gray._212;
  }

  public static Color getTreeTextBackground() {
    return UIManager.getColor("Tree.textBackground");
  }

  public static void drawImage(Graphics g, Image image, int x, int y, ImageObserver observer) {
    if (image instanceof JBHiDPIScaledImage) {
      final Graphics2D newG = (Graphics2D) g.create(x, y, image.getWidth(observer), image.getHeight(observer));
      newG.scale(0.5, 0.5);
      Image img = ((JBHiDPIScaledImage) image).getDelegate();