remove fixed color assignment

This commit is contained in:
Eyck Jentzsch 2020-04-02 14:15:01 +02:00
parent fb283ab668
commit 20824e75c1
1 changed files with 6 additions and 25 deletions

View File

@ -52,30 +52,11 @@ public class TrackEntry {
result[0] = fallback; result[0] = fallback;
result[1] = highlightedFallback; result[1] = highlightedFallback;
// assign colors to standard values // assign "random" color here, one name always results in the same color!
if (streamValue.contains("read")){ if( streamValue!=null && randomColors.length > 0 ) {
result[0] = new Color(86,174,53); int index = Math.abs(streamValue.hashCode()) % randomColors.length;
result[1] = new Color (86,194,53); result[0] = randomColors[index][0];
}else if (streamValue.contains("rdata")){ result[1] = randomColors[index][1];
result[0] = new Color(138,151,71);
result[1] = new Color (138,171,71);
}else if (streamValue.contains("addr")){
result[0] = new Color(233,187,68);
result[1] = new Color (233,207,68);
}else if (streamValue.contains("write")){
result[0] = new Color(1,128,191);
result[1] = new Color (1,128,211);
}else if (streamValue.contains("wdata")){
result[0] = new Color(2,181,160);
result[1] = new Color (2,201,160);
}else {
// assign "random" color here, one name always results in the same color!
if( randomColors.length > 0 ) {
int index = Math.abs(streamValue.hashCode()) % randomColors.length;
result[0] = randomColors[index][0];
result[1] = randomColors[index][1];
}
} }
return result; return result;