MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / readTextColors

Method readTextColors

src/main/java/net/optifine/CustomColors.java:1532–1570  ·  view source on GitHub ↗
(Properties props, String fileName, String prefix, String logName)

Source from the content-addressed store, hash-verified

1530 }
1531
1532 private static int[] readTextColors(Properties props, String fileName, String prefix, String logName)
1533 {
1534 int[] aint = new int[32];
1535 Arrays.fill((int[])aint, (int) - 1);
1536 int i = 0;
1537
1538 for (Object e: props.keySet())
1539 {
1540 String s = (String) e;
1541 String s1 = props.getProperty(s);
1542
1543 if (s.startsWith(prefix))
1544 {
1545 String s2 = StrUtils.removePrefix(s, prefix);
1546 int j = Config.parseInt(s2, -1);
1547 int k = parseColor(s1);
1548
1549 if (j >= 0 && j < aint.length && k >= 0)
1550 {
1551 aint[j] = k;
1552 ++i;
1553 }
1554 else
1555 {
1556 warn("Invalid color: " + s + " = " + s1);
1557 }
1558 }
1559 }
1560
1561 if (i <= 0)
1562 {
1563 return null;
1564 }
1565 else
1566 {
1567 dbg(logName + " colors: " + i);
1568 return aint;
1569 }
1570 }
1571
1572 public static int getTextColor(int index, int color)
1573 {

Callers 1

readColorPropertiesMethod · 0.95

Calls 8

removePrefixMethod · 0.95
parseIntMethod · 0.95
parseColorMethod · 0.95
warnMethod · 0.95
dbgMethod · 0.95
startsWithMethod · 0.80
keySetMethod · 0.45
getPropertyMethod · 0.45

Tested by

no test coverage detected