This is just checking words. You can create all the possible combinations and check them.
If you really want to work with colors, they are represented by 3 color components on computers. These are typically red, green, blue.
For instance, the blue color is (0, 0, 1); i.e. 0 red, 0 green and 1 blue.
If you want deeper blue, you'd do (0, 0, 0.5) for instance.
So red (1, 0, 0) + blue (0, 0, 1) would result in (1, 0, 1).