I want to put the following code inside the header to achieve the effect shown below.
I tried adding the code to Caddyfile and got an error when I run the Caddy server.
loading module 'headers': provision http.handlers.headers: replacement 0 for header field 'moomin00': error parsing regexp: missing closing ]: `[38;5;237mâ–„%1b[38;5;235mâ–„%1b[49m

Well that's a wacky usecase if I've ever seen one.
I figure you didn't wrap the value in double quotes or in backticks so Caddy read it as multiple separate tokens.
For next time, please ask your usage questions on the Caddy community forums. We prefer to keep the GitHub issue board for bugs and feature requests. Don't forget to fill out the thread template so we can help you!
Ha, I kinda love this idea.
For anyone finding this, the solution is here: https://caddy.community/t/how-can-put-this-character-to-header/9317/5?u=matt
Go strips leading whitespace in header values (sad face) so you can trick it by inserting a non-breaking space character at the start of each line.