How do I put colored carpet on my head?
The replaceitem
syntax for entities is:
/replaceitem entity <selector> <slot> <item> [amount] [data] [dataTag]
The carpet's colour is represented by its data value (sometimes called "damage value"). Currently you have it set to 0, which is white. You can see these values here.
For example, for lime carpet:
/replaceitem entity @p slot.armor.head minecraft:carpet 1 5