The black colour in cats is due to a dominant gene that produces a pigment called melanin, which is responsible for the colour of skin, hair and eyes. The gene is inherited from both parents, and the more copies of the gene a cat has, the darker its fur will be.
The black colour in cats can also be influenced by other genes, such as those that control the amount of white spotting on a cat's coat. Additionally, environmental factors such as diet and exposure to sunlight can also affect the colour of a cat's fur.