Reputation: 17
I want to print out the block character(█) as any rgb colour(#000000-#ffffff). I'm aware of the ANSI colours and the ANSI 8-bit however the colours are to limited for my use. How can I best achieve full RBG color range on terminal?
This will only be used for UNIX/UNIX like OS, there will be no windows use.
Upvotes: 0
Views: 955
Reputation: 3845
Unless you use a custom/non-standard terminal emulator, all eventual libraries will be based on the ANSI control sequences. If that is not sufficient for your use, you should consider making a gui application. Also as @KamilCuk pointed out in the comments, the ANSI colors are not limited to 8 bits but to 24 bits, which allows you to specify any (#000000-#ffffff) color.
If you are designing a command line UI, you should also keep in mind, that not all people use a "white font on black background" terminal color scheme. While you can achieve "cool" color effects with the 24 bit colors, I would encourage you to respect the users color scheme choice and stick to the 3 and 4 bit colors (described in this section). If you do that, your command line program will be much more likely to look and work well even on terminals with a light colorscheme.
Upvotes: 2