Keep the text color of the terminal output

I'm wondering if it's possible to keep text color formatting when saving the terminal output to a file.

For example, when you use inxiif I run this command: sudo inxi -Fxxx >> inxi.txt, I would like all colors to be such that I see them on the screen when I do not redirect the output. The same would be true if I performed a ls order, etc.

Ideally, I'd like to do this from the command line at once, but I'm willing to cut and collate if needed. What I do not want to do is edit the output and manually change the color of the text.

Thank you in advance for any help.