It decodes it from binary code to a certain order of single to combining the next/previous color LED.
Time || RED | GREEN | BLUE || COMBINED COLOR
1 || 1 | 0 | 0 || RED
2 || 1 | 1 | 0 || YELLOW
3 || 0 | 1 | 0 || GREEN
4 || 0 | 1 | 1 || CIAN
5 || 0 | 0 | 1 || BLUE
6 || 1 | 0 | 1 || PURPLE