Loading ...
Sorry, an error occurred while loading the content.

max colors in text based terminals

Expand Messages
  • sinbad
    this may not be a specific vim question, but i was wondering what s the maximum no.of colors that can be supported in text-based terminals, until recently i
    Message 1 of 13 , Jun 3, 2012
    • 0 Attachment
      this may not be a specific vim question, but i was wondering
      what's the maximum no.of colors that can be supported in
      text-based terminals, until recently i use to work with 16 colors.
      i just learnt about the xterm-256 colors and enjoying it. so, i was
      wondering what's the maximum number of colors that can be
      supported in text based terminals.

      cheers

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Christian Brabandt
      Hi sinbad! ... That depends on your terminal. Most terminals nowadays support either 256 (xterm) or 88 (rxvt) colors. regards, Christian -- -- You received
      Message 2 of 13 , Jun 3, 2012
      • 0 Attachment
        Hi sinbad!

        On So, 03 Jun 2012, sinbad wrote:

        > this may not be a specific vim question, but i was wondering
        > what's the maximum no.of colors that can be supported in
        > text-based terminals, until recently i use to work with 16 colors.
        > i just learnt about the xterm-256 colors and enjoying it. so, i was
        > wondering what's the maximum number of colors that can be
        > supported in text based terminals.

        That depends on your terminal. Most terminals nowadays support either
        256 (xterm) or 88 (rxvt) colors.

        regards,
        Christian
        --

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Magnus Woldrich
        ... Someone who isn t me claims that the terminal that comes with KDE, Konsole , can do lots more . If that is really the case that d be fantastic, but I
        Message 3 of 13 , Jun 3, 2012
        • 0 Attachment
          >> this may not be a specific vim question, but i was wondering
          >> what's the maximum no.of colors that can be supported in
          >> text-based terminals, until recently i use to work with 16 colors.
          >> i just learnt about the xterm-256 colors and enjoying it. so, i was
          >> wondering what's the maximum number of colors that can be
          >> supported in text based terminals.

          Someone who isn't me claims that the terminal that comes with KDE, 'Konsole',
          can do 'lots more'.
          If that is really the case that'd be fantastic, but I wonder what sort of hack
          they've added to vte and how much stuff they've broken in the process.

          I've never managed to build Konsole, maybe someone who already have it installed
          could take a look.

          Here's a little known fact: the extended colors isn't static, so you can give
          all 256 slots exactly the color values you want. Might be a good idea to use
          something that can generate those for you though, else it could be pretty time
          consuming. :)

          --
          Magnus Woldrich
          m@..., woldrich@...
          irc: scp1 on freenode
          uri: http://japh.se

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • sinbad
          ... my question is are there any terminal implementations that support more than 256 colors in text consoles not in gui. -- You received this message from the
          Message 4 of 13 , Jun 3, 2012
          • 0 Attachment
            On Jun 3, 4:03 pm, Christian Brabandt <cbli...@...> wrote:
            > Hi sinbad!
            >
            > On So, 03 Jun 2012, sinbad wrote:
            >
            > > this may not be a specific vim question, but i was wondering
            > > what's the maximum no.of colors that can be supported in
            > > text-based terminals, until recently i use to work with 16 colors.
            > > i just learnt about the xterm-256 colors and enjoying it. so, i was
            > > wondering what's the maximum number of colors that can be
            > > supported in text based terminals.
            >
            > That depends on your terminal. Most terminals nowadays support either
            > 256 (xterm) or 88 (rxvt) colors.
            >
            > regards,
            > Christian
            > --

            my question is are there any terminal implementations that support
            more than 256 colors in text consoles not in gui.

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Chris Jones
            ... Konsole and derivatives support a 24-bit color palette, i.e. they let you display 16,777,216 colors concurrently. ... Other terminal emulators provide a
            Message 5 of 13 , Jun 3, 2012
            • 0 Attachment
              On Sun, Jun 03, 2012 at 08:38:31AM EDT, sinbad wrote:

              > my question is are there any terminal implementations that support
              > more than 256 colors in text consoles not in gui.

              Konsole and derivatives support a 24-bit color palette, i.e. they let you
              display 16,777,216 colors concurrently.

              This link looks like a useful entry-point:

              |◎https://github.com/robertknight/konsole/blob/master/user-doc/README.moreColors

              Other terminal emulators provide a user-modifiable palette of 8, 16, 88,
              or 256 colors chosen among the 16,777,216 colors typically supported by
              current hardware.

              CJ

              --
              Have a nice day!

              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Charlie Kester
              ... But how many text-mode apps are there that can use more than 256 colors at a time? If they re using ncurses, they re limited by what that library supports.
              Message 6 of 13 , Jun 4, 2012
              • 0 Attachment
                On 06/03/2012 11:14 AM, Chris Jones wrote:
                > On Sun, Jun 03, 2012 at 08:38:31AM EDT, sinbad wrote:
                >
                >> my question is are there any terminal implementations that support
                >> more than 256 colors in text consoles not in gui.
                >
                > Konsole and derivatives support a 24-bit color palette, i.e. they let you
                > display 16,777,216 colors concurrently.

                But how many text-mode apps are there that can use more than 256 colors
                at a time?

                If they're using ncurses, they're limited by what that library supports.
                (256 colors max, IIRC.) Dittos for slang-based apps.

                It's been a while since I looked at konsole (I use roxterm myself), but
                what many terminal emulators let you do is map a subset of those 16M
                colors into the 256-color palette used by the apps. That's not quite
                the same as letting you display all 16M colors concurrently.



                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              • Chris Jones
                ... [..] ... None that I m aware of. ... Well, I don t use Konsole, but from what I understand you are pretty much limited to using hard-coded escape
                Message 7 of 13 , Jun 4, 2012
                • 0 Attachment
                  On Mon, Jun 04, 2012 at 01:03:40PM EDT, Charlie Kester wrote:
                  > On 06/03/2012 11:14 AM, Chris Jones wrote:

                  [..]

                  > > Konsole and derivatives support a 24-bit color palette, i.e. they
                  > > let you display 16,777,216 colors concurrently.

                  > But how many text-mode apps are there that can use more than 256
                  > colors at a time?

                  None that I'm aware of.

                  > If they're using ncurses, they're limited by what that library
                  > supports. (256 colors max, IIRC.) Dittos for slang-based apps.

                  Well, I don't use Konsole, but from what I understand you are pretty
                  much limited to using hard-coded escape sequences.

                  > It's been a while since I looked at konsole (I use roxterm myself),
                  > but what many terminal emulators let you do is map a subset of those
                  > 16M colors into the 256-color palette used by the apps. That's not
                  > quite the same as letting you display all 16M colors concurrently.

                  The purpose of syntax highlighting being to help differentiate text
                  elements at a glance, I'm not sure the ability to display 16M colors
                  concurrently (or 256, even..น) is in itself relevant. Of course there is
                  a useful side-effect, whereby if terminfo, ncurses, console Vim etc.
                  supported 16M colors, gVim color schemes would be directly portable and
                  display in the same colors on such terminals as on the GUI.

                  All the same, I'd be curious to know what the Konsole developers had in
                  mind when they implemented 16M colors supportฒ.

                  CJ

                  น unless they happen to be right next to each other I can't tell the
                  difference between between grey 235/236, and even then I have to look
                  close.. never mind the difference between #0F0F0F and #101010.

                  ฒ keeping in mind, that this adds up to over 281 trillion color pairs:
                  makes for a huge display if you want to display them all at the same
                  time.

                  --
                  AHH! The neurotic monkeys are after me!

                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php
                • Thomas E. Dickey
                  ... konsole implements the xterm 256-color controls (256 * 256 * 256). It s not 16M * 16M * 16M. -- You received this message from the vim_use maillist. Do
                  Message 8 of 13 , Jun 4, 2012
                  • 0 Attachment
                    On Jun 4, 4:00 pm, Chris Jones <cjns1...@...> wrote:

                    > All the same, I'd be curious to know what the Konsole developers had in
                    > mind when they implemented 16M colors support .

                    konsole implements the xterm 256-color controls (256 * 256 * 256).
                    It's not 16M * 16M * 16M.

                    --
                    You received this message from the "vim_use" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php
                  • Tony Mechelynck
                    ... It s never 16M * 16M * 16M, which would be a bedazzling 4.7e21, or 2^72 colors. 16M is 256 * 256 * 256 (256 red times 256 green times 256 blue, or #000000
                    Message 9 of 13 , Jun 4, 2012
                    • 0 Attachment
                      On 05/06/12 02:35, Thomas E. Dickey wrote:
                      > On Jun 4, 4:00 pm, Chris Jones <cjns1...@...> wrote:
                      >
                      >> All the same, I'd be curious to know what the Konsole developers had in
                      >> mind when they implemented 16M colors support .
                      >
                      > konsole implements the xterm 256-color controls (256 * 256 * 256).
                      > It's not 16M * 16M * 16M.
                      >
                      It's never 16M * 16M * 16M, which would be a bedazzling 4.7e21, or 2^72
                      colors. 16M is 256 * 256 * 256 (256 red times 256 green times 256 blue,
                      or #000000 to #FFFFFF), and that's what most modern GUIs support
                      (including X11, Windows, Cocoa, and also on a different level the HTML
                      and CSS used by your browser). konsole implements the 256 colors (not
                      256 cubed but 256 /in toto/) of xterm-256 terminals, by means of a
                      palette which includes the 6 * 6 * 6 = 216 "safe" colors (red 00 to FF
                      in steps of 33, green 00 to FF in steps of 33, blue 00 to FF in steps of
                      33), plus some additional "greyscale" colors (additional shades of
                      grey), and I think that the 16 "lowest" colors of the palette are
                      downward-compatible to the colors of 16-color terminals (which use one
                      bit each for bold, red, green and blue, 1=on, 0=off).

                      Best regards,
                      Tony.
                      --
                      Basic is a high level languish.
                      APL is a high level anguish.

                      --
                      You received this message from the "vim_use" maillist.
                      Do not top-post! Type your reply below the text you are replying to.
                      For more information, visit http://www.vim.org/maillist.php
                    • John Little
                      ... My konsole (2.7.4) really does do 256 cubed colours, 16Mi, or appears to be trying to as far as my eyes can see. Picking a colour randomly from rgb.txt,
                      Message 10 of 13 , Jun 4, 2012
                      • 0 Attachment
                        On Tuesday, June 5, 2012 1:26:30 PM UTC+12, Tony Mechelynck wrote:
                        > ...konsole implements the 256 colors (not 256 cubed but 256 /in toto/)...

                        My konsole (2.7.4) really does do 256 cubed colours, 16Mi, or appears to be trying to as far as my eyes can see.
                        Picking a colour randomly from rgb.txt, dark salmon, in bash:

                        $ echo $'\e[38;2;233;150;122m hello \e[0m'

                        Chris Jones asked:
                        >The purpose of syntax highlighting being to help differentiate text
                        >elements at a glance, I'm not sure the ability to display 16M colors
                        >concurrently is in itself relevant.
                        A developer looking at code all day long, every day, can tweak the colours to get ones he or she likes.

                        >All the same, I'd be curious to know what the Konsole developers had in
                        >mind when they implemented 16M colors support.

                        Compatibility with guis, maybe. Or maybe it was just there.

                        Regards, John

                        --
                        You received this message from the "vim_use" maillist.
                        Do not top-post! Type your reply below the text you are replying to.
                        For more information, visit http://www.vim.org/maillist.php
                      • Chris Jones
                        ... My impression was that xterm lets you specify 256 colors using the #000000 .. #ffffff syntax.. in effect letting you override the defaults and define a
                        Message 11 of 13 , Jun 5, 2012
                        • 0 Attachment
                          On Mon, Jun 04, 2012 at 08:35:18PM EDT, Thomas Dickey wrote:
                          > On Jun 4, 4:00 pm, Chris Jones <cjns1...@...> wrote:

                          > > All the same, I'd be curious to know what the Konsole developers had in
                          > > mind when they implemented 16M colors support .
                          >
                          > konsole implements the xterm 256-color controls (256 * 256 * 256).
                          > It's not 16M * 16M * 16M.

                          My impression was that xterm lets you specify 256 colors using the
                          #000000 .. #ffffff syntax.. in effect letting you override the defaults
                          and define a custom 256-color palette chosen among the possible 16M..

                          I became curious about Konsole supporting true color so I booted an iso
                          that ships it and ran the following bash commands:

                          | g=0
                          | b=0
                          |
                          | for r in $(seq 0 255)
                          | do
                          | echo -e "\033[48;2;${r};${g};${b}m $r $g $b"
                          | done

                          If saw what definitely looked like a gradient that went from pure black
                          to the brightest red with 256 intermediate shades of red.

                          I ran the same script on an xterm (debian stable v261-1) and afaict it
                          did not understand the above syntax: the background color remained the
                          original default black.

                          Is this something you enable at ‘./configure’ time.. or is xterm's
                          syntax different from Konsole's..?

                          Back on Konsole, I tried a similar script that goes through all 16M
                          color combinations:

                          | for r in $(seq 0 255)
                          | do
                          | for g in $(seq 0 255)
                          | do
                          | for b in $(seq 0 255)
                          | do
                          | echo -e -n "\033[38;2;${r};${g};${b}33m█████████"
                          | done
                          | done
                          | done

                          This seemed to work as well, but the output was so large that I can't be
                          sure I was really getting 16M colors. Even with the smallest font
                          I could find, no way I could display it all on one screen. I guess I'd
                          have to come up with something a little smarter.

                          In any case, my point was that I don't see this feature as something
                          very useful.. unless you want to develop for Konsole exclusively using
                          hard-coded escape sequences.

                          As expected, I didn't see a terminfo entry that had ‘colors#16777216’
                          and ‘pairs#281474976710656’...

                          That's why I was wondering what the Konsole developers were planning to
                          do with this feature and went to the trouble of coding it.

                          CJ

                          --
                          WE GET SIGNAL

                          --
                          You received this message from the "vim_use" maillist.
                          Do not top-post! Type your reply below the text you are replying to.
                          For more information, visit http://www.vim.org/maillist.php
                        • Thomas E. Dickey
                          ... yes - but see below ... xterm looks for 5 ( 38;5 ), that s documented and well-known. Is konsole s format documented anywhere except for a comment in the
                          Message 12 of 13 , Jun 5, 2012
                          • 0 Attachment
                            On Jun 5, 3:00 am, Chris Jones <cjns1...@...> wrote:
                            > On Mon, Jun 04, 2012 at 08:35:18PM EDT, Thomas Dickey wrote:
                            > > On Jun 4, 4:00 pm, Chris Jones <cjns1...@...> wrote:
                            > > > All the same, I'd be curious to know what the Konsole developers had in
                            > > > mind when they implemented 16M colors support .
                            >
                            > > konsole implements the xterm256-color controls (256 * 256 * 256).
                            > > It's not 16M * 16M * 16M.
                            >
                            > My impression was that xterm lets you specify 256 colors using the
                            > #000000 .. #ffffff syntax.. in effect letting you override the defaults
                            > and define a custom 256-color palette chosen among the possible 16M..

                            yes - but see below

                            > I became curious about Konsole supporting true color so I booted an iso
                            > that ships it and ran the following bash commands:
                            >
                            > | g=0
                            > | b=0
                            > |
                            > | for r in $(seq 0 255)
                            > |   do
                            > |     echo -e "\033[48;2;${r};${g};${b}m $r $g $b"
                            > |   done
                            >
                            > If saw what definitely looked like a gradient that went from pure black
                            > to the brightest red with 256 intermediate shades of red.
                            >
                            > I ran the same script on an xterm(debian stable v261-1) and afaict it
                            > did not understand the above syntax: the background color remained the
                            > original default black.
                            >
                            > Is this something you enable at ‘./configure’ time.. or is xterm's
                            > syntax different from Konsole's..?
                            >
                            > Back on Konsole, I tried a similar script that goes through all 16M
                            > color combinations:
                            >
                            > | for r in $(seq 0 255)
                            > |   do
                            > |     for g in $(seq 0 255)
                            > |       do
                            > |         for b in $(seq 0 255)
                            > |           do
                            > |             echo -e -n "\033[38;2;${r};${g};${b}33m█████████"
                            > |           done
                            > |       done
                            > |   done
                            >
                            > This seemed to work as well, but the output was so large that I can't be
                            > sure I was really getting 16M colors. Even with the smallest font
                            > I could find, no way I could display it all on one screen. I guess I'd
                            > have to come up with something a little smarter.

                            xterm looks for 5 ("38;5"), that's documented and well-known.
                            Is konsole's format documented anywhere except for a comment in the
                            code?
                            (I can read the source code - not many comments there - I do see some
                            TODO's
                            suggesting that someone document the color behavior).

                            What you're describing is a built-in algorithm for the color palette.
                            Reading the code, I see its behavior for 256-colors is also hardcoded,
                            which means that it cannot set any of the palette entries. So konsole
                            implements no more than half of the xterm feature.

                            The other terminals (starting with xterm of course) allow an
                            application to set colors.
                            vte-based stuff is closer to konsole in this regard (a bug report
                            states that the
                            display is not updated after changing the palette), so I suppose vte-
                            based stuff will
                            sooner or later "implement" this detail.

                            > In any case, my point was that I don't see this feature as something
                            > very useful.. unless you want to develop for Konsole exclusively using
                            > hard-coded escape sequences.
                            >
                            > As expected, I didn't see a terminfo entry that had ‘colors#16777216’
                            > and ‘pairs#281474976710656’...

                            There won't be (binary terminfo stores 16-bit numbers, and given the
                            tradeoffs,
                            it's unlikely there'll be significant demand for a new/incompatible
                            format).

                            > That's why I was wondering what the Konsole developers were planning to
                            > do with this feature and went to the trouble of coding it.

                            proof of concept, perhaps. Or hard-coded applications. It took
                            someone
                            an afternoon to code - no "trouble" involved.

                            --
                            You received this message from the "vim_use" maillist.
                            Do not top-post! Type your reply below the text you are replying to.
                            For more information, visit http://www.vim.org/maillist.php
                          • Chris Jones
                            ... [..] ... My understanding is that the 38;5 and the 38;2 have different goals: ... Robert Knight appears to have been the Konsole s main dev -- c.
                            Message 13 of 13 , Jun 6, 2012
                            • 0 Attachment
                              On Tue, Jun 05, 2012 at 05:50:45AM EDT, Thomas Dickey wrote:
                              > On Jun 5, 3:00 am, Chris Jones <cjns1...@...> wrote:

                              [..]

                              > xterm looks for 5 ("38;5"), that's documented and well-known.

                              My understanding is that the "38;5" and the "38;2" have different goals:

                              From Konsole's README.moreColors:

                              | The konsole adopted some ESC codes allowing to use extended
                              | color spaces.
                              |
                              | There is a predefined 256 color space compatible with his
                              | xterm sister, and, even beyond that, a 3-byte RGB color space.
                              |
                              | The ESC codes are as follows:
                              |
                              | ESC[ ... 38;2;<r>;<g>;<b> ... m Select RGB foreground color
                              | ESC[ ... 48;2;<r>;<g>;<b> ... m Select RGB background color
                              |
                              | ESC[ ... 38;5;<i> ... m Select indexed foreground color
                              | ESC[ ... 48;5;<i> ... m Select indexed background color

                              > Is konsole's format documented anywhere except for a comment in the
                              > code?

                              | https://github.com/robertknight/konsole/blob/disable-wordwrap/user-doc/README.moreColors

                              Robert Knight appears to have been the Konsole's main dev' -- c. 2008.

                              > What you're describing is a built-in algorithm for the color palette.
                              > Reading the code, I see its behavior for 256-colors is also hardcoded,
                              > which means that it cannot set any of the palette entries. So konsole
                              > implements no more than half of the xterm feature.

                              I eventually downloaded Kubuntu 12.04 and ran the following commands:

                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;${i};0;0m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;0;${i};0m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;0;0;${i}m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;${i};128;128m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;128;${i};128m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;128;128;${i}m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;${i};192;192m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;192;${i};192m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;192;192;${i}m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;${i};224;224m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;224;${i};224m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;224;224;${i}m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;${i};64;64m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;64;${i};64m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;64;64;${i}m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;${i};32;32m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;32;${i};32m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;32;32;${i}m█"; done; echo
                              | for i in $(seq 0 255); do echo -e -n "\033[38;2;255;255;${i}m█"; done; echo

                              Since many people don't have Konsole installed on their system, I took
                              the liberty of attaching a (small) screenshot of the output.

                              There are clearly more than 256 colors concurrently displayed.

                              Not included in the screenshot, I ran the equivalent of 256color2.pl in
                              between each of the above commands, just to make sure that Konsole's
                              default 256-color palette was unaffected.

                              CJ

                              --
                              ALL YOUR BASE ARE BELONG TO US!

                              --
                              You received this message from the "vim_use" maillist.
                              Do not top-post! Type your reply below the text you are replying to.
                              For more information, visit http://www.vim.org/maillist.php
                            Your message has been successfully submitted and would be delivered to recipients shortly.