use of com.intellij.ui.JBColor in project intellij-community by JetBrains.
the class EditorEmptyTextPainter method paintEmptyText.
public void paintEmptyText(@NotNull final JComponent splitters, @NotNull Graphics g) {
UISettings.setupAntialiasing(g);
g.setColor(new JBColor(Gray._80, Gray._160));
g.setFont(JBUI.Fonts.label(16f));
UIUtil.TextPainter painter = new UIUtil.TextPainter().withLineSpacing(1.8f);
advertiseActions(splitters, painter);
painter.draw(g, (width, height) -> {
Dimension s = splitters.getSize();
int w = (s.width - width) / 2;
int h = (int) (s.height * heightRatio());
return Couple.of(w, h);
});
}
use of com.intellij.ui.JBColor in project intellij-community by JetBrains.
the class ImmediatePainter method getCaretColor.
private static Color getCaretColor(final Editor editor) {
Color overriddenColor = editor.getCaretModel().getPrimaryCaret().getVisualAttributes().getColor();
if (overriddenColor != null)
return overriddenColor;
final Color caretColor = editor.getColorsScheme().getColor(EditorColors.CARET_COLOR);
return caretColor == null ? new JBColor(Gray._0, Gray._255) : caretColor;
}
use of com.intellij.ui.JBColor in project intellij-community by JetBrains.
the class DesignerEditorPanel method createScrollPane.
protected JScrollPane createScrollPane(@NotNull JLayeredPane content) {
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(content);
scrollPane.setBackground(new JBColor(Color.WHITE, UIUtil.getListBackground()));
return scrollPane;
}
use of com.intellij.ui.JBColor in project intellij-community by JetBrains.
the class DefaultColorGenerator method calcColor.
@NotNull
private static JBColor calcColor(int indexColor) {
int r = indexColor * 200 + 30;
int g = indexColor * 130 + 50;
int b = indexColor * 90 + 100;
try {
Color color = new Color(rangeFix(r), rangeFix(g), rangeFix(b));
return new JBColor(color, color);
} catch (IllegalArgumentException a) {
throw new IllegalArgumentException("indexColor: " + indexColor + " " + r % 256 + " " + (g % 256) + " " + (b % 256));
}
}
use of com.intellij.ui.JBColor in project intellij-community by JetBrains.
the class IpnbEditorUtil method createPromptComponent.
public static JLabel createPromptComponent(@Nullable Integer promptNumber, @NotNull final PromptType type) {
final String promptText = prompt(promptNumber, type);
JLabel promptLabel = new JLabel(promptText);
promptLabel.setHorizontalAlignment(SwingConstants.RIGHT);
promptLabel.setMinimumSize(PROMPT_SIZE);
promptLabel.setPreferredSize(PROMPT_SIZE);
final Font font = promptLabel.getFont();
assert font != null;
promptLabel.setFont(font.deriveFont(Font.BOLD));
final JBColor darkRed = new JBColor(new Color(210, 30, 50), new Color(210, 30, 50));
promptLabel.setForeground(type == PromptType.In ? JBColor.BLUE : darkRed);
promptLabel.setBackground(getBackground());
return promptLabel;
}
Aggregations