/** * Returns a color based on the color configured for the given annotation type and the given scale factor. * * @param annotationType the annotation type * @param scale the scale factor * @return the computed color */ private Color getColor(Object annotationType, double scale) { Color base= findColor(annotationType); if (base == null) return null; RGB baseRGB= base.getRGB(); RGB background= fCanvas.getBackground().getRGB(); boolean darkBase= isDark(baseRGB); boolean darkBackground= isDark(background); if (darkBase && darkBackground) background= new RGB(255, 255, 255); else if (!darkBase && !darkBackground) background= new RGB(0, 0, 0); return fSharedTextColors.getColor(interpolate(baseRGB, background, scale)); }
/** * Returns a color based on the color configured for the given annotation type and the given scale factor. * * @param annotationType the annotation type * @param scale the scale factor * @return the computed color */ private Color getColor(Object annotationType, double scale) { Color base= findColor(annotationType); if (base == null) return null; RGB baseRGB= base.getRGB(); RGB background= fCanvas.getBackground().getRGB(); boolean darkBase= isDark(baseRGB); boolean darkBackground= isDark(background); if (darkBase && darkBackground) background= new RGB(255, 255, 255); else if (!darkBase && !darkBackground) background= new RGB(0, 0, 0); return fSharedTextColors.getColor(interpolate(baseRGB, background, scale)); }