various: fixes (#2893)

change brand colour to blue from orange.

change star colour to blue.

change config on toggle to blue.

change runelite logo to openosrs.
This commit is contained in:
Kyle
2021-01-05 05:57:49 +00:00
committed by GitHub
parent 8b7c1591f2
commit 7bca26f146
10 changed files with 70 additions and 17 deletions

View File

@@ -380,7 +380,7 @@ public class Notifier
{
if (OSType.getOSType() == OSType.Linux && !Files.exists(notifyIconPath))
{
try (InputStream stream = Notifier.class.getResourceAsStream("/runelite.png"))
try (InputStream stream = Notifier.class.getResourceAsStream("/openosrs.png"))
{
Files.copy(stream, notifyIconPath);
}

View File

@@ -285,7 +285,7 @@ class ConfigPanel extends PluginPanel
String name = cs.name();
final JLabel sectionName = new JLabel(name);
sectionName.setForeground(ColorScheme.BRAND_ORANGE);
sectionName.setForeground(ColorScheme.BRAND_BLUE);
sectionName.setFont(FontManager.getRunescapeBoldFont());
sectionName.setToolTipText("<html>" + name + ":<br>" + cs.description() + "</html>");
sectionHeader.add(sectionName, BorderLayout.CENTER);

View File

@@ -76,7 +76,7 @@ class PluginListItem extends JPanel implements SearchablePlugin
BufferedImage configIcon = ImageUtil.getResourceStreamFromClass(ConfigPanel.class, "config_edit_icon.png");
BufferedImage onStar = ImageUtil.getResourceStreamFromClass(ConfigPanel.class, "star_on.png");
CONFIG_ICON = new ImageIcon(configIcon);
ON_STAR = new ImageIcon(onStar);
ON_STAR = new ImageIcon(ImageUtil.recolorImage(onStar, ColorScheme.BRAND_BLUE));
CONFIG_ICON_HOVER = new ImageIcon(ImageUtil.luminanceOffset(configIcon, -100));
BufferedImage offStar = ImageUtil.luminanceScale(
@@ -216,7 +216,7 @@ class PluginListItem extends JPanel implements SearchablePlugin
}
/**
* Adds a mouseover effect to change the text of the passed label to {@link ColorScheme#BRAND_ORANGE} color, and
* Adds a mouseover effect to change the text of the passed label to {@link ColorScheme#BRAND_BLUE} color, and
* adds the passed menu items to a popup menu shown when the label is clicked.
*
* @param label The label to attach the mouseover and click effects to
@@ -258,7 +258,7 @@ class PluginListItem extends JPanel implements SearchablePlugin
public void mouseEntered(MouseEvent mouseEvent)
{
lastForeground = label.getForeground();
label.setForeground(ColorScheme.BRAND_ORANGE);
label.setForeground(ColorScheme.BRAND_BLUE);
}
@Override

View File

@@ -29,6 +29,7 @@ import java.awt.Dimension;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import javax.swing.JToggleButton;
import net.runelite.client.ui.ColorScheme;
import net.runelite.client.util.ImageUtil;
import net.runelite.client.util.SwingUtil;
@@ -40,7 +41,7 @@ class PluginToggleButton extends JToggleButton
static
{
BufferedImage onSwitcher = ImageUtil.getResourceStreamFromClass(ConfigPanel.class, "switcher_on.png");
ON_SWITCHER = new ImageIcon(onSwitcher);
ON_SWITCHER = new ImageIcon(ImageUtil.recolorImage(onSwitcher, ColorScheme.BRAND_BLUE));
OFF_SWITCHER = new ImageIcon(ImageUtil.flipImage(
ImageUtil.luminanceScale(
ImageUtil.grayscaleImage(onSwitcher),

View File

@@ -108,7 +108,7 @@ public class ClientUI
private static final String CONFIG_CLIENT_BOUNDS = "clientBounds";
private static final String CONFIG_CLIENT_MAXIMIZED = "clientMaximized";
private static final String CONFIG_CLIENT_SIDEBAR_CLOSED = "clientSidebarClosed";
public static final BufferedImage ICON = ImageUtil.getResourceStreamFromClass(ClientUI.class, "/runelite.png");
public static final BufferedImage ICON = ImageUtil.getResourceStreamFromClass(ClientUI.class, "/openosrs.png");
@Getter
private TrayIcon trayIcon;
@@ -1121,4 +1121,4 @@ public class ClientUI
configManager.setConfiguration(CONFIG_GROUP, CONFIG_CLIENT_BOUNDS, bounds);
}
}
}
}

View File

@@ -96,8 +96,8 @@ public class SplashScreen extends JFrame implements ActionListener
y += action.getHeight() + PAD;
pane.add(progress);
progress.setForeground(ColorScheme.BRAND_ORANGE);
progress.setBackground(ColorScheme.BRAND_ORANGE.darker().darker());
progress.setForeground(ColorScheme.BRAND_BLUE);
progress.setBackground(ColorScheme.BRAND_BLUE.darker().darker());
progress.setBorder(new EmptyBorder(0, 0, 0, 0));
progress.setBounds(0, y, WIDTH, 14);
progress.setFont(font);

View File

@@ -67,7 +67,7 @@ public class FlatTextField extends JPanel
this.textField.setBorder(null);
this.textField.setOpaque(false);
this.textField.setSelectedTextColor(Color.WHITE);
this.textField.setSelectionColor(ColorScheme.BRAND_ORANGE_TRANSPARENT);
this.textField.setSelectionColor(ColorScheme.BRAND_BLUE_TRANSPARENT);
add(textField, BorderLayout.CENTER);
@@ -175,4 +175,4 @@ public class FlatTextField extends JPanel
return textField.getDocument();
}
}
}

View File

@@ -51,7 +51,7 @@ import net.runelite.client.ui.ColorScheme;
public class MaterialTab extends JLabel
{
private static final Border SELECTED_BORDER = new CompoundBorder(
BorderFactory.createMatteBorder(0, 0, 1, 0, ColorScheme.BRAND_ORANGE),
BorderFactory.createMatteBorder(0, 0, 1, 0, ColorScheme.BRAND_BLUE),
BorderFactory.createEmptyBorder(5, 10, 4, 10));
private static final Border UNSELECTED_BORDER = BorderFactory
@@ -165,4 +165,4 @@ public class MaterialTab extends JLabel
setForeground(Color.GRAY);
selected = false;
}
}
}

View File

@@ -34,10 +34,12 @@ import java.awt.image.BufferedImage;
import java.awt.image.DirectColorModel;
import java.awt.image.PixelGrabber;
import java.awt.image.RescaleOp;
import java.awt.image.WritableRaster;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
import javax.imageio.ImageIO;
import javax.swing.GrayFilter;
import lombok.extern.slf4j.Slf4j;
@@ -398,6 +400,56 @@ public class ImageUtil
return filledImage;
}
/**
* Recolors pixels of the given image with the given color based on a given recolor condition
* predicate.
*
* @param image The image which should have its non-transparent pixels recolored.
* @param color The color with which to recolor pixels.
* @param recolorCondition The condition on which to recolor pixels with the given color.
* @return The given image with all pixels fulfilling the recolor condition predicate
* set to the given color.
*/
public static BufferedImage recolorImage(final BufferedImage image, final Color color, final Predicate<Color> recolorCondition)
{
final BufferedImage recoloredImage = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_ARGB);
for (int x = 0; x < recoloredImage.getWidth(); x++)
{
for (int y = 0; y < recoloredImage.getHeight(); y++)
{
final Color pixelColor = new Color(image.getRGB(x, y), true);
if (!recolorCondition.test(pixelColor))
{
recoloredImage.setRGB(x, y, image.getRGB(x, y));
continue;
}
recoloredImage.setRGB(x, y, color.getRGB());
}
}
return recoloredImage;
}
public static BufferedImage recolorImage(BufferedImage image, final Color color)
{
int width = image.getWidth();
int height = image.getHeight();
WritableRaster raster = image.getRaster();
for (int xx = 0; xx < width; xx++)
{
for (int yy = 0; yy < height; yy++)
{
int[] pixels = raster.getPixel(xx, yy, (int[]) null);
pixels[0] = color.getRed();
pixels[1] = color.getGreen();
pixels[2] = color.getBlue();
raster.setPixel(xx, yy, pixels);
}
}
return image;
}
/**
* Performs a rescale operation on the image's color components.
*

View File

@@ -83,11 +83,11 @@ public class SwingUtil
UIManager.put("MenuItem.foreground", Color.WHITE);
UIManager.put("Panel.background", ColorScheme.DARK_GRAY_COLOR);
UIManager.put("ScrollBarUI", CustomScrollBarUI.class.getName());
UIManager.put("TextField.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT);
UIManager.put("TextField.selectionBackground", ColorScheme.BRAND_BLUE_TRANSPARENT);
UIManager.put("TextField.selectionForeground", Color.WHITE);
UIManager.put("FormattedTextField.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT);
UIManager.put("FormattedTextField.selectionBackground", ColorScheme.BRAND_BLUE_TRANSPARENT);
UIManager.put("FormattedTextField.selectionForeground", Color.WHITE);
UIManager.put("TextArea.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT);
UIManager.put("TextArea.selectionBackground", ColorScheme.BRAND_BLUE_TRANSPARENT);
UIManager.put("TextArea.selectionForeground", Color.WHITE);
// Do not render shadows under popups/tooltips.