Colos of macros in a writer document

Hello,
I want to write documents to explain a few macros, and I want to keep the
same colors in the (for macros written in the document) as the LibreOffice
BASIC IDE.
Is there a way (software, extension, ...) to achieve this?
Regards,

I do something similar using macros (ironic right?)

Mostly I do this based on paragraph styles to know where the code is to colorize. You can also just select text and colorize that.

I don't remember if I used the same colors as the macro editor.

If you want a copy, let me know and I can send you a copy packaged as an extension...

⁣Sent from BlueMail ​

Andrew's extension can be found here:

https://extensions.libreoffice.org/en/extensions/show/code-colorizer-formatter