It's not 3 colors+black. It's 3 colors+another color.
The NES has 4 palettes that can be on screen at a time for backgrounds.
Each 16x16 part of the background can use only one palette.
Each palette has four color entries. 3 color entries in each palette can be unique. The fourth color has to be the same in all 4 palettes.
So
1. (Brown)
2. Green
3. Light Green
4. Blue
1. (Brown)
2. Light Brown
3. White
4. Red
1. (Brown)
2. Beige
3. Purple
4. Orange
1. (Brown)
2. Blue
3. Light Blue
4. White
Is a valid set of palettes. Brown is the color that is the same in all four. If I changed it, to say... black in one palette it would change it to black in all the palettes.
As well, you can't use any color. You have to use colors from a specific set:
http://bisqwit.iki.fi/utils/nespalette.php Unless you use color emphasis, all your colors must be from the top four rows there.