How are LEGO Bricks and colors numbered/identified
Parts have a design ID, and an element ID.

The design ID applies to the part - eg 1x6 brick 

Similar parts, with different colors have different ELEMENT ID’s.  Before -1998 these were in the form of designID+colorID. 
Now the design ID is not easily related to element ID

Occasionally, after a period of absence, a piece may be re-released in a color. Eg sand green 1x6 was element 4155053 from 2000-2012 eg monster fighters haunted house and then reappeared as 6177081 in 2017 eg Minecraft ocean monument.

The design ID of the first version of an element tends be be used by bricklink, whereas LEGO will normally change the design ID if there is a significant change to the mold. Eg the thickness/shape of clips.

Brickset.com lists parts by both element and design ID when you look at inventories for a given set. 

Colour IDs can also be found at Brickset, who also refer to Ryan Howerter’s website as a resource 

I hope this helps answer your question.