Ruby: console producing untypical colors

Hello my name is Daniel I am starting with Ruby and the way the replit platform shows the code is not what it should be on the computer console the colors and spaces are fine. Here it is not shown as it should.
Can someone give me an idea of ​​the problem?

Could you provide some screenshots and/or a link to a repl where you can produce this? I’m not 100% clear on what you mean so some more information to clarify would be good and help me or another member of the community help you out :slight_smile:

8-colour codes, which is what colorize uses, will produce different colours depending on theme/app. If you want specific colours that will stay the same everywhere, use 256-colour ansi codes, e.g.

puts "\x1b[38;5;99mfoo\x1b[m"

Replace 99 with the colour code of your choice:

1 Like