Mainly you're looking to replace just the primaries taht are missing. If you match the finished colour and add that, it won't be right due to adding to what is still in the carpet.
Not that I'm a crayon colour repair expert, just learning but starting to appreciate what others have said for a while.
Once you start doing the odd job, you start thinking in Primaries and Secondary colours and try picking what's missing, what it looks like now, and what it needs to restore.
A big eye opener for me was a job I did a few months back where I had a cream carpet with blue (Cyan printer ink) dribbled on the carpet. I actually had to add an orange crayon colour to it and it practically disappeared immediately!! (Too much blue, balance it by adding the two primaries - red and yellow=orange - the additional red and yellow balanced out the additional blue)
John