Java Code Examples for com.intellij.ui.ColorUtil#desaturate()

The following examples show how to use com.intellij.ui.ColorUtil#desaturate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FlutterProjectStep.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void updateSdkField(JTextComponent sdkEditor) {
  FlutterSdk current = FlutterSdk.forPath(sdkEditor.getText());
  Color color = sdkBackgroundColor;
  if (current == null) {
    if (ColorUtil.isDark(sdkBackgroundColor)) {
      color = ColorUtil.darker(JBColor.YELLOW, 5);
    }
    else {
      color = ColorUtil.desaturate(JBColor.YELLOW, 15);
    }
  }
  sdkEditor.setBackground(color);
}
 
Example 2
Source File: FlutterProjectStep.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void updateSdkField(JTextComponent sdkEditor) {
  FlutterSdk current = FlutterSdk.forPath(sdkEditor.getText());
  Color color = sdkBackgroundColor;
  if (current == null) {
    if (ColorUtil.isDark(sdkBackgroundColor)) {
      color = ColorUtil.darker(JBColor.YELLOW, 5);
    }
    else {
      color = ColorUtil.desaturate(JBColor.YELLOW, 15);
    }
  }
  sdkEditor.setBackground(color);
}
 
Example 3
Source File: RectangleReferencePainter.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
public static Color getLabelColor(@Nonnull Color color) {
  if (UIUtil.isUnderDarcula()) {
    color = ColorUtil.darker(color, 6);
  }
  else {
    color = ColorUtil.brighter(color, 6);
  }
  return ColorUtil.desaturate(color, 3);
}
 
Example 4
Source File: ReferencesPanel.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
public static Color getLabelColor(@Nonnull Color color) {
  if (UIUtil.isUnderDarcula()) {
    color = ColorUtil.darker(color, 6);
  }
  else {
    color = ColorUtil.brighter(color, 6);
  }
  return ColorUtil.desaturate(color, 3);
}
 
Example 5
Source File: MacAquaUIDecorator.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public Color getSidebarColor() {
  Color color = IntelliJLaf.isGraphite() ? DarculaUIUtil.MAC_GRAPHITE_COLOR : DarculaUIUtil.MAC_REGULAR_COLOR;

  return ColorUtil.desaturate(color, 8);
}
 
Example 6
Source File: DefaultUIDecorator.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
private Color calcSidebarColor() {
  Color color = UIManager.getColor("Hyperlink.linkColor");
  if (color == null) {
    color = DarculaUIUtil.MAC_REGULAR_COLOR;
  }
  return StyleManager.get().getCurrentStyle().isDark() ? ColorUtil.darker(color, 10) : ColorUtil.desaturate(color, 18);
}