BrickLink maintains a table of all colors that were officially released by LEGO. Take a look at our Color Guide to see what colors are currently defined in the system. Only Parts and Gear can be assigned colors. All other item types are automatically assigned the (Not Applicable) color.
Known Colors:
Known colors for a part or gear are based on inventory appearances in Sets, Books, Gear and Minifigs. The system will also loop through up to 10 levels of appearances if for example a part appears in another part which appears in another part which appears in a minifig which appears in a set.

Known colors on a catalog detail page is real time data. Known colors on the sell item, add item to my wanted list and catalog search pages is cached and updated once a day at 12am based on inventory appearances.

All Gear items can be assigned colors but only some should actually be assigned colors. The catalog detail page shows a breakdown by color if either the small image is in an actual color or the gear item appears in an inventory in a specific color. Otherwise, the item availability section shows just a total number of items for sale, items wanted, etc.