Warning, /utilities/konsole/doc/user/README.moreColors is written in an unsupported language. File is not indexed.
0001 [README.moreColors] 0002 0003 The konsole adopted some ESC codes allowing to use extended 0004 color spaces. 0005 0006 There is a predefined 256 color space compatible with his 0007 xterm sister, and, even beyond that, a 3-byte RGB color space. 0008 0009 The ESC codes are as follows: 0010 0011 ESC[ ... 38;2;<r>;<g>;<b> ... m Select RGB foreground color 0012 ESC[ ... 48;2;<r>;<g>;<b> ... m Select RGB background color 0013 0014 ESC[ ... 38;5;<i> ... m Select indexed foreground color 0015 ESC[ ... 48;5;<i> ... m Select indexed background color 0016 0017 <r>,<g> and <b> are each values in the range of 0..255 and 0018 represent the brightness as usual for the respective color. 0019 0020 <i> likely is a value in 0..256, but represents an indexed 0021 color assignment composed as follows: 0022 0023 0 .. 15 - System color, these are taken from the schema. 0024 16 .. 231 - Forms a 6x6x6 RGB color cube. 0025 232 .. 255 - A gray scale ramp without black and white. 0026 0027 Try the tests/color-spaces.pl to visualize the assignment. 0028 0029 0030 ---------------------------------------------------------------- 0031 0032 A note on conformance 0033 0034 These ESC codes break the "associativity" of SGR, but after some 0035 research the result is, that the standard itself is broken here. 0036 0037 The perhaps best codes due to ECMA-48 would probably be e.g. 0038 38:2:<r>:<g>:<b>, i.e. consistently a colon instead of a semicolon. 0039 But apparently, this is defined different in ISO-8613 (which is 0040 included at this place in ECMA-48), actually breaking ECMA-48. 0041 0042 We cannot help this and implemented the codes as above, which 0043 is a balanced decision. 0044 0045 For 256 color mode, this is compatible with xterm and perhaps 0046 with other xterm compatible terminal emulations. 0047 0048 0049 | ------- Additional Comments From awendt putergeek com 2006-06-07 07:40 ------- 0050 | > So a parameter substring is 0-9 and the colon. The semicolon separates 0051 | > sub-parameters. Thus 48:5:<Color> would be one sub-parameter, and 0052 | > 48;5;<Color> many independent, each having an independent meaning in case 0053 | > of a selective parameter. 0054 | 0055 | 0056 | I think you may be onto something here with the colons... I was able to find 0057 | ITU T.416 (which is the same as ISO 8613-6) and it says: 0058 | 0059 | --- snip --- 0060 | 0061 | The parameter values 38 and 48 are followed by a parameter substring used to 0062 | select either the character foreground ?colour value? or the character 0063 | background ?colour value?. 0064 | 0065 | A parameter substring for values 38 or 48 may be divided by one or more 0066 | separators (03/10) into parameter elements, denoted as Pe. The format of such 0067 | a parameter sub-string is indicated as: 0068 | 0069 | Pe : P ... 0070 | 0071 | Each parameter element consists of zero, one or more bit combinations from 0072 | 03/00 to 03/09, representing the digits 0 to 9. An empty parameter element 0073 | represents a default value for this parameter element. Empty parameter 0074 | elements at the end of the parameter substring need not be included. 0075 | 0076 | The first parameter element indicates a choice between: 0077 | 0078 | 0 implementation defined (only applicable for the character 0079 | foreground colour) 0080 | 1 transparent; 0081 | 2 direct colour in RGB space; 0082 | 3 direct colour in CMY space; 0083 | 4 direct colour in CMYK space; 0084 | 5 indexed colour. 0085 | 0086 | If the first parameter has the value 0 or 1, there are no additional parameter 0087 | elements. 0088 | 0089 | If the first parameter element has the value 5, then there is a second 0090 | parameter element specifying the index into the colour table given by the 0091 | attribute ?content colour table? applying to the object with which the 0092 | content is associated. 0093 | 0094 | --- snip --- 0095 | 0096 | The separator character 03/10 they use is a colon, not a semicolon... I wonder 0097 | if the xterm implementation was based on an improper reading of the standard? 0098 |