Skin color is determined by melanocyte cells in the skin and hair follicles. Those cells produce melanin which in turn produce the color.
The skin of a cat may sometimes change color or become lighter or darker. This may be a normal process, or may be due to a serious disease. If the skin has a color other than white, it is said to be 'pigmented.' Colors include brown, black, red, purplish-blue, and yellow. If the skin is a darker color than normal, it is said to be 'hyperpigmented.'
Same thing applies in the dog also.There are two types of pigment that create coat colour in dogs (and most other mammals). Pigment is the thing that gives each strand of hair its colour, just like pigment in paint or dye, or pigment in your own hair or skin. All coat colours and patterns in dogs are created by these two pigments, which are both forms of melanin. Each of the pigments has a"default" colour, and it can then be modified by various genes.