The tag function:
https://github.com/Rainrider/oUF_Lay...gs.lua#L15-L31
Registering it with oUF:
https://github.com/Rainrider/oUF_Lay.../tags.lua#L172
Setting up the events:
https://github.com/Rainrider/oUF_Lay.../tags.lua#L173
Setting up the font strings (creation, placement, building a compound tag):
https://github.com/Rainrider/oUF_Lay....lua#L195-L219
Attaching it to a unit frame:
https://github.com/Rainrider/oUF_Lay...rimary.lua#L59
As for the colors, you are advised not to overwrite oUF colors directly but rather use a metatable. See
here for an example.