AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
ColormapCount.java
Go to the documentation of this file.
1package aud.util;
2
4public class ColormapCount extends Colormap<Integer> {
5 @Override public int getRGB(Integer data) {
6
7 if (data<0)
8 return 0xff00ff; // magenta
9
10 switch (data) {
11 case 0: return 0xffffff;
12 case 1: return 0x202020;
13 case 2: return 0x0000ff;
14 case 3: return 0x00aaff;
15 case 4: return 0x00ffff;
16 case 5: return 0x00ffaa;
17 case 6: return 0x00ff00;
18 case 7: return 0xaaff00;
19 case 8: return 0xffff00;
20 case 9: return 0xffaa00;
21 case 10: return 0xff5500;
22 default: return 0xff0000; // red
23 }
24 }
25}
color map for (small) positive integer counts
int getRGB(Integer data)
simple interface for color map
Definition: Colormap.java:4