I like this idea, although I think that they should be only one code, which might program both the foreground and background (and font styles if applicable), rather than separate codes for foreground and for background.

Yes, since this morning, I've thought a little more and agree. (I just finished replying to another reply.)

Anyone interested, ping me (address in profile) and encourage me to set up a repo to discuss and formulate a concrete proposal.

OK, I've started making notes on this at https://codeberg.org/datatravelandexperiments/semantic-termi... . Feel free to jump in, or volunteer to adopt the whole thing.