ground items plugin: Use ColorUtil functions

This commit is contained in:
Jordan Atwood
2018-07-17 10:24:41 -07:00
parent be91d3ce26
commit f43a2e0162

View File

@@ -76,6 +76,7 @@ import static net.runelite.client.plugins.grounditems.config.MenuHighlightMode.B
import static net.runelite.client.plugins.grounditems.config.MenuHighlightMode.NAME;
import static net.runelite.client.plugins.grounditems.config.MenuHighlightMode.OPTION;
import net.runelite.client.ui.overlay.OverlayManager;
import net.runelite.client.util.ColorUtil;
import net.runelite.http.api.item.ItemPrice;
@PluginDescriptor(
@@ -381,19 +382,17 @@ public class GroundItemsPlugin extends Plugin
if (color != null && canBeRecolored && !color.equals(config.defaultColor()))
{
String hexColor = Integer.toHexString(color.getRGB() & 0xFFFFFF);
String colTag = "<col=" + hexColor + ">";
final MenuHighlightMode mode = config.menuHighlightMode();
if (mode == BOTH || mode == OPTION)
{
lastEntry.setOption(colTag + "Take");
lastEntry.setOption(ColorUtil.prependColorTag("Take", color));
}
if (mode == BOTH || mode == NAME)
{
String target = lastEntry.getTarget().substring(lastEntry.getTarget().indexOf(">") + 1);
lastEntry.setTarget(colTag + target);
lastEntry.setTarget(ColorUtil.prependColorTag(target, color));
}
}