Search in sources :

Example 46 with JBColor

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);
    });
}
Also used : JBColor(com.intellij.ui.JBColor) UIUtil(com.intellij.util.ui.UIUtil)

Example 47 with JBColor

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;
}
Also used : JBColor(com.intellij.ui.JBColor) JBColor(com.intellij.ui.JBColor)

Example 48 with JBColor

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;
}
Also used : JBColor(com.intellij.ui.JBColor)

Example 49 with JBColor

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));
    }
}
Also used : JBColor(com.intellij.ui.JBColor) JBColor(com.intellij.ui.JBColor) NotNull(org.jetbrains.annotations.NotNull)

Example 50 with JBColor

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;
}
Also used : JBColor(com.intellij.ui.JBColor) JBColor(com.intellij.ui.JBColor)

Aggregations

JBColor (com.intellij.ui.JBColor)51 GraphicsConfig (com.intellij.openapi.ui.GraphicsConfig)8 NotNull (org.jetbrains.annotations.NotNull)8 SimpleTextAttributes (com.intellij.ui.SimpleTextAttributes)4 Rectangle2D (java.awt.geom.Rectangle2D)4 UIUtil (com.intellij.util.ui.UIUtil)3 Project (com.intellij.openapi.project.Project)2 BalloonLayout (com.intellij.ui.BalloonLayout)2 BalloonLayoutData (com.intellij.ui.BalloonLayoutData)2 StudyStatus (com.jetbrains.edu.learning.courseFormat.StudyStatus)2 RoundRectangle2D (java.awt.geom.RoundRectangle2D)2 BasicArrowButton (javax.swing.plaf.basic.BasicArrowButton)2 Nullable (org.jetbrains.annotations.Nullable)2 ItemResourceValue (com.android.ide.common.rendering.api.ItemResourceValue)1 ResourceValue (com.android.ide.common.rendering.api.ResourceValue)1 LegendComponent (com.android.tools.adtui.LegendComponent)1 LegendRenderData (com.android.tools.adtui.LegendRenderData)1 TimelineComponent (com.android.tools.adtui.TimelineComponent)1 ConfiguredThemeEditorStyle (com.android.tools.idea.editors.theme.datamodels.ConfiguredThemeEditorStyle)1 MergedManifest (com.android.tools.idea.model.MergedManifest)1