To add a code, form the appointment book go to Setup >> Codes:
From there you can add/edit/remove codes. You can choose the colour of a code and it will appear as the foreground or background of appointments with that code**.
Then when you are in the Edit Appointment screen you can choose it from the drop-down menu:
**The foreground / background option is in Setup >> General >> Appointment Background Code Colour:
More info can be found here: https://help.medilink.com.au/support/solutions/articles/11000040871-background-text-colour-settings
Below is a comparison of the code display setting - foreground vs background: