Will it add colour - absolutely. The colour will last for several washes.
But here we get nitpicky
Coffee and tea stains the cloth. To dye the cloth, we need a mineral to act as a go-between. Think of it as false teeth to help the colour bite into the cloth. This is usually called a mordent (thus the teeth metaphor).
If this is cotton or
linen, tannin acts as a partial mordant. Tea and coffee have loads of tannen so this is a good step. However, if we want the colour to last well in the light and wash, adding a mineral like alum (available for cheap in the garden supply shop but is also available as a food additive (think pickles) or from a dye supplier) will help.
The worry for me is the temperature. We usually boil cloth to dye it but some clothing is held together with synthetic
thread that doesn't do well in those conditions. I wonder is
solar dyeing is an option where you are?