You start with 2, which is a prime number, and then you can exclude every multiple of 2 (2,4,6,8,etc) because its impossible for any of those to be prime since they are divisible by 2. Then you go to the next "free" number which is 3 and can then exclude any multiple of 3 that didnt already get excluded by 2 (9,15,21,etc). The next number is 4, but its been excluded already so the next "free" number is 5. Repeat for 5 and the next number is 7. Every time you get to a new number that hasn't already been excluded means that it is a prime number.
The colors are just to help visually see the excluded/prime/free numbers. Dark color means its prime, lighter shade of that color means its excluded by that prime and gray means its a free number that hasn't been determined yet.
The colors are just to help visually see the excluded/prime/free numbers. Dark color means its prime, lighter shade of that color means its excluded by that prime and gray means its a free number that hasn't been determined yet.