@Override public Color getTextColor() { Duration timeLeft = Duration.between(Instant.now(), endTime); //check if timer has 10% of time left if (timeLeft.getSeconds() < (duration.getSeconds() * .10)) { return Color.RED.brighter(); } return Color.WHITE; }
public void setLinePaint(Paint linePaint) { super.setLinePaint(linePaint); if (linePaint instanceof Color) { brighter = ((Color) linePaint).brighter(); } else { // TODO add fancy logic for GradientPaint etc... brighter = linePaint; } }
@Signature public Color brighter() { return color.brighter(); }
@Override public void mousePressed(MouseEvent mouseEvent) { if (mouseEvent.getClickCount() == 2) { setBackground(getBackground().brighter()); } }
protected void paintComponent(Graphics graphics) { //super.paintComponent(graphics); // paint background GradientPaint gradientPaint = new GradientPaint(0, 0, getBackground().darker(), 0, getHeight()/2.0f, getBackground().brighter(), true); Color color = graphics.getColor(); final Graphics2D graphics2D = (Graphics2D)graphics; graphics2D.setPaint(gradientPaint); graphics2D.fillRect(0, 0, getWidth(), getHeight()); graphics2D.setColor(color); }
@Override public Color getTextColor() { return (up ? plugin.getChangeUpTicks() : plugin.getChangeDownTicks()) < 10 ? Color.RED.brighter() : Color.WHITE; }
final Color pressedColor = ColorScheme.DARKER_GRAY_COLOR.brighter();
public ProgressBar() { setLayout(new BorderLayout()); // The background color should be overridden setBackground(Color.GREEN.darker()); setForeground(Color.GREEN.brighter()); setPreferredSize(new Dimension(100, 16)); leftLabel.setFont(FontManager.getRunescapeSmallFont()); leftLabel.setForeground(Color.WHITE); leftLabel.setBorder(new EmptyBorder(2, 5, 0, 0)); rightLabel.setFont(FontManager.getRunescapeSmallFont()); rightLabel.setForeground(Color.WHITE); rightLabel.setBorder(new EmptyBorder(2, 0, 0, 5)); centerLabel.setFont(FontManager.getRunescapeSmallFont()); centerLabel.setForeground(Color.WHITE); centerLabel.setHorizontalAlignment(SwingConstants.CENTER); centerLabel.setBorder(new EmptyBorder(2, 0, 0, 0)); // Adds components to be automatically redrawn when paintComponents is called add(leftLabel, BorderLayout.WEST); add(centerLabel, BorderLayout.CENTER); add(rightLabel, BorderLayout.EAST); }
@Override public void mouseEntered(MouseEvent mouseEvent) { WorldTableRow.this.lastBackground = getBackground(); setBackground(getBackground().brighter()); }
@Override public Dimension render(Graphics2D graphics) { NPC core = corpPlugin.getCore(); if (core != null) { Polygon canvasTilePoly = core.getCanvasTilePoly(); if (canvasTilePoly != null) { OverlayUtil.renderPolygon(graphics, canvasTilePoly, Color.RED.brighter()); } } return null; } }
public void paintButtonPressed(Graphics g, AbstractButton b) { paintText(g, b, b.getBounds(), b.getText()); g.setColor(Color.red.brighter()); g.fillRect(0, 0, b.getSize().width, b.getSize().height);
private void updateBackground() { if (isAvailable) { this.setBorder(GREEN_BORDER); } else if (isOverlapping) { this.setBorder(ORANGE_BORDER); } else { this.setBorder(RED_BORDER); } setBackground(this.isSelected() ? ColorScheme.DARKER_GRAY_HOVER_COLOR.brighter() : ColorScheme.DARKER_GRAY_COLOR); }
Color red = Color.red.brighter(); g2.setColor(red); mg.plotNode(g2, qGraph.getNodeAccess(), fromRes.getClosestNode(), red, 10, ""); mg.plotNode(g2, qGraph.getNodeAccess(), toRes.getClosestNode(), red, 10, ""); g2.setColor(Color.blue.brighter().brighter()); path = algo.calcPath(fromRes.getClosestNode(), toRes.getClosestNode()); sw.stop();
AutoSuggestor autoSuggestor = new AutoSuggestor(f, frame, null, Color.WHITE.brighter(), Color.BLUE, Color.RED, 0.75f) { @Override boolean wordTyped(String typedWord) {
public void paintShinyBackground(Color bright, Color dark) { paintGradient(dark, bright); double ellipseWidth = (double)width * 1.5; double ellipseHeight = (double)height * 1.1; double x = (double)width / 2.0 - ellipseWidth / 2.0; double y = ellipseHeight * -0.55; Ellipse2D shape = new Ellipse2D.Double(x, y, ellipseWidth, ellipseHeight); Graphics2D graphics = image.createGraphics(); try { graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics.setPaint(new GradientPaint(0f, 0f, bright.brighter(), 0f, (float)shape.getHeight(), dark.brighter())); graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.6f)); graphics.fill(shape); } finally { graphics.dispose(); } }
private void paintBackground(Graphics2D graphics, AbstractButton b) { Graphics2D g = (Graphics2D) graphics.create(); try { g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.4f)); Color startingColor = look.colors().shadow().brighter().brighter(); Color endingColor = look.colors().shadow().darker(); g.setPaint(new GradientPaint(0, 0, startingColor, 0, b.getHeight(), endingColor)); g.fillRect(1, 1, b.getWidth()-2, b.getHeight()-2); } finally { g.dispose(); } }