Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Suggestions ➜ xTerm support...

xTerm support...

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2  3 4  

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #30 on Sat 07 Apr 2007 03:14 AM (UTC)
Message
A bit more research indicates maybe this is the correct gap sequence:


// the 6 value iterations in the xterm color cube
static const unsigned char valuerange[] = { 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF };


This is different from my original sequence (DF becomes D7), but at least the gaps are more consistent now:


95 + 40 + 40 + 40 + 40 = 255


This gives the following codes:


16 (black)                R=  0 G=  0 B=  0 #000000 &h000000 0x000000 
17                        R=  0 G=  0 B= 95 #00005F &h5F0000 0x5F0000 
18                        R=  0 G=  0 B=135 #000087 &h870000 0x870000 
19                        R=  0 G=  0 B=175 #0000AF &hAF0000 0xAF0000 
20                        R=  0 G=  0 B=215 #0000D7 &hD70000 0xD70000 
21 (blue)                 R=  0 G=  0 B=255 #0000FF &hFF0000 0xFF0000 
22                        R=  0 G= 95 B=  0 #005F00 &h005F00 0x005F00 
23                        R=  0 G= 95 B= 95 #005F5F &h5F5F00 0x5F5F00 
24                        R=  0 G= 95 B=135 #005F87 &h875F00 0x875F00 
25                        R=  0 G= 95 B=175 #005FAF &hAF5F00 0xAF5F00 
26                        R=  0 G= 95 B=215 #005FD7 &hD75F00 0xD75F00 
27                        R=  0 G= 95 B=255 #005FFF &hFF5F00 0xFF5F00 
28                        R=  0 G=135 B=  0 #008700 &h008700 0x008700 
29                        R=  0 G=135 B= 95 #00875F &h5F8700 0x5F8700 
30                        R=  0 G=135 B=135 #008787 &h878700 0x878700 
31                        R=  0 G=135 B=175 #0087AF &hAF8700 0xAF8700 
32                        R=  0 G=135 B=215 #0087D7 &hD78700 0xD78700 
33                        R=  0 G=135 B=255 #0087FF &hFF8700 0xFF8700 
34                        R=  0 G=175 B=  0 #00AF00 &h00AF00 0x00AF00 
35                        R=  0 G=175 B= 95 #00AF5F &h5FAF00 0x5FAF00 
36                        R=  0 G=175 B=135 #00AF87 &h87AF00 0x87AF00 
37                        R=  0 G=175 B=175 #00AFAF &hAFAF00 0xAFAF00 
38                        R=  0 G=175 B=215 #00AFD7 &hD7AF00 0xD7AF00 
39                        R=  0 G=175 B=255 #00AFFF &hFFAF00 0xFFAF00 
40                        R=  0 G=215 B=  0 #00D700 &h00D700 0x00D700 
41                        R=  0 G=215 B= 95 #00D75F &h5FD700 0x5FD700 
42                        R=  0 G=215 B=135 #00D787 &h87D700 0x87D700 
43                        R=  0 G=215 B=175 #00D7AF &hAFD700 0xAFD700 
44                        R=  0 G=215 B=215 #00D7D7 &hD7D700 0xD7D700 
45                        R=  0 G=215 B=255 #00D7FF &hFFD700 0xFFD700 
46 (lime)                 R=  0 G=255 B=  0 #00FF00 &h00FF00 0x00FF00 
47                        R=  0 G=255 B= 95 #00FF5F &h5FFF00 0x5FFF00 
48                        R=  0 G=255 B=135 #00FF87 &h87FF00 0x87FF00 
49                        R=  0 G=255 B=175 #00FFAF &hAFFF00 0xAFFF00 
50                        R=  0 G=255 B=215 #00FFD7 &hD7FF00 0xD7FF00 
51 (cyan, aqua)           R=  0 G=255 B=255 #00FFFF &hFFFF00 0xFFFF00 
52                        R= 95 G=  0 B=  0 #5F0000 &h00005F 0x00005F 
53                        R= 95 G=  0 B= 95 #5F005F &h5F005F 0x5F005F 
54                        R= 95 G=  0 B=135 #5F0087 &h87005F 0x87005F 
55                        R= 95 G=  0 B=175 #5F00AF &hAF005F 0xAF005F 
56                        R= 95 G=  0 B=215 #5F00D7 &hD7005F 0xD7005F 
57                        R= 95 G=  0 B=255 #5F00FF &hFF005F 0xFF005F 
58                        R= 95 G= 95 B=  0 #5F5F00 &h005F5F 0x005F5F 
59                        R= 95 G= 95 B= 95 #5F5F5F &h5F5F5F 0x5F5F5F 
60                        R= 95 G= 95 B=135 #5F5F87 &h875F5F 0x875F5F 
61                        R= 95 G= 95 B=175 #5F5FAF &hAF5F5F 0xAF5F5F 
62                        R= 95 G= 95 B=215 #5F5FD7 &hD75F5F 0xD75F5F 
63                        R= 95 G= 95 B=255 #5F5FFF &hFF5F5F 0xFF5F5F 
64                        R= 95 G=135 B=  0 #5F8700 &h00875F 0x00875F 
65                        R= 95 G=135 B= 95 #5F875F &h5F875F 0x5F875F 
66                        R= 95 G=135 B=135 #5F8787 &h87875F 0x87875F 
67                        R= 95 G=135 B=175 #5F87AF &hAF875F 0xAF875F 
68                        R= 95 G=135 B=215 #5F87D7 &hD7875F 0xD7875F 
69                        R= 95 G=135 B=255 #5F87FF &hFF875F 0xFF875F 
70                        R= 95 G=175 B=  0 #5FAF00 &h00AF5F 0x00AF5F 
71                        R= 95 G=175 B= 95 #5FAF5F &h5FAF5F 0x5FAF5F 
72                        R= 95 G=175 B=135 #5FAF87 &h87AF5F 0x87AF5F 
73                        R= 95 G=175 B=175 #5FAFAF &hAFAF5F 0xAFAF5F 
74                        R= 95 G=175 B=215 #5FAFD7 &hD7AF5F 0xD7AF5F 
75                        R= 95 G=175 B=255 #5FAFFF &hFFAF5F 0xFFAF5F 
76                        R= 95 G=215 B=  0 #5FD700 &h00D75F 0x00D75F 
77                        R= 95 G=215 B= 95 #5FD75F &h5FD75F 0x5FD75F 
78                        R= 95 G=215 B=135 #5FD787 &h87D75F 0x87D75F 
79                        R= 95 G=215 B=175 #5FD7AF &hAFD75F 0xAFD75F 
80                        R= 95 G=215 B=215 #5FD7D7 &hD7D75F 0xD7D75F 
81                        R= 95 G=215 B=255 #5FD7FF &hFFD75F 0xFFD75F 
82                        R= 95 G=255 B=  0 #5FFF00 &h00FF5F 0x00FF5F 
83                        R= 95 G=255 B= 95 #5FFF5F &h5FFF5F 0x5FFF5F 
84                        R= 95 G=255 B=135 #5FFF87 &h87FF5F 0x87FF5F 
85                        R= 95 G=255 B=175 #5FFFAF &hAFFF5F 0xAFFF5F 
86                        R= 95 G=255 B=215 #5FFFD7 &hD7FF5F 0xD7FF5F 
87                        R= 95 G=255 B=255 #5FFFFF &hFFFF5F 0xFFFF5F 
88                        R=135 G=  0 B=  0 #870000 &h000087 0x000087 
89                        R=135 G=  0 B= 95 #87005F &h5F0087 0x5F0087 
90                        R=135 G=  0 B=135 #870087 &h870087 0x870087 
91                        R=135 G=  0 B=175 #8700AF &hAF0087 0xAF0087 
92                        R=135 G=  0 B=215 #8700D7 &hD70087 0xD70087 
93                        R=135 G=  0 B=255 #8700FF &hFF0087 0xFF0087 
94                        R=135 G= 95 B=  0 #875F00 &h005F87 0x005F87 
95                        R=135 G= 95 B= 95 #875F5F &h5F5F87 0x5F5F87 
96                        R=135 G= 95 B=135 #875F87 &h875F87 0x875F87 
97                        R=135 G= 95 B=175 #875FAF &hAF5F87 0xAF5F87 
98                        R=135 G= 95 B=215 #875FD7 &hD75F87 0xD75F87 
99                        R=135 G= 95 B=255 #875FFF &hFF5F87 0xFF5F87 
100                       R=135 G=135 B=  0 #878700 &h008787 0x008787 
101                       R=135 G=135 B= 95 #87875F &h5F8787 0x5F8787 
102                       R=135 G=135 B=135 #878787 &h878787 0x878787 
103                       R=135 G=135 B=175 #8787AF &hAF8787 0xAF8787 
104                       R=135 G=135 B=215 #8787D7 &hD78787 0xD78787 
105                       R=135 G=135 B=255 #8787FF &hFF8787 0xFF8787 
106                       R=135 G=175 B=  0 #87AF00 &h00AF87 0x00AF87 
107                       R=135 G=175 B= 95 #87AF5F &h5FAF87 0x5FAF87 
108                       R=135 G=175 B=135 #87AF87 &h87AF87 0x87AF87 
109                       R=135 G=175 B=175 #87AFAF &hAFAF87 0xAFAF87 
110                       R=135 G=175 B=215 #87AFD7 &hD7AF87 0xD7AF87 
111                       R=135 G=175 B=255 #87AFFF &hFFAF87 0xFFAF87 
112                       R=135 G=215 B=  0 #87D700 &h00D787 0x00D787 
113                       R=135 G=215 B= 95 #87D75F &h5FD787 0x5FD787 
114                       R=135 G=215 B=135 #87D787 &h87D787 0x87D787 
115                       R=135 G=215 B=175 #87D7AF &hAFD787 0xAFD787 
116                       R=135 G=215 B=215 #87D7D7 &hD7D787 0xD7D787 
117                       R=135 G=215 B=255 #87D7FF &hFFD787 0xFFD787 
118                       R=135 G=255 B=  0 #87FF00 &h00FF87 0x00FF87 
119                       R=135 G=255 B= 95 #87FF5F &h5FFF87 0x5FFF87 
120                       R=135 G=255 B=135 #87FF87 &h87FF87 0x87FF87 
121                       R=135 G=255 B=175 #87FFAF &hAFFF87 0xAFFF87 
122                       R=135 G=255 B=215 #87FFD7 &hD7FF87 0xD7FF87 
123                       R=135 G=255 B=255 #87FFFF &hFFFF87 0xFFFF87 
124                       R=175 G=  0 B=  0 #AF0000 &h0000AF 0x0000AF 
125                       R=175 G=  0 B= 95 #AF005F &h5F00AF 0x5F00AF 
126                       R=175 G=  0 B=135 #AF0087 &h8700AF 0x8700AF 
127                       R=175 G=  0 B=175 #AF00AF &hAF00AF 0xAF00AF 
128                       R=175 G=  0 B=215 #AF00D7 &hD700AF 0xD700AF 
129                       R=175 G=  0 B=255 #AF00FF &hFF00AF 0xFF00AF 
130                       R=175 G= 95 B=  0 #AF5F00 &h005FAF 0x005FAF 
131                       R=175 G= 95 B= 95 #AF5F5F &h5F5FAF 0x5F5FAF 
132                       R=175 G= 95 B=135 #AF5F87 &h875FAF 0x875FAF 
133                       R=175 G= 95 B=175 #AF5FAF &hAF5FAF 0xAF5FAF 
134                       R=175 G= 95 B=215 #AF5FD7 &hD75FAF 0xD75FAF 
135                       R=175 G= 95 B=255 #AF5FFF &hFF5FAF 0xFF5FAF 
136                       R=175 G=135 B=  0 #AF8700 &h0087AF 0x0087AF 
137                       R=175 G=135 B= 95 #AF875F &h5F87AF 0x5F87AF 
138                       R=175 G=135 B=135 #AF8787 &h8787AF 0x8787AF 
139                       R=175 G=135 B=175 #AF87AF &hAF87AF 0xAF87AF 
140                       R=175 G=135 B=215 #AF87D7 &hD787AF 0xD787AF 
141                       R=175 G=135 B=255 #AF87FF &hFF87AF 0xFF87AF 
142                       R=175 G=175 B=  0 #AFAF00 &h00AFAF 0x00AFAF 
143                       R=175 G=175 B= 95 #AFAF5F &h5FAFAF 0x5FAFAF 
144                       R=175 G=175 B=135 #AFAF87 &h87AFAF 0x87AFAF 
145                       R=175 G=175 B=175 #AFAFAF &hAFAFAF 0xAFAFAF 
146                       R=175 G=175 B=215 #AFAFD7 &hD7AFAF 0xD7AFAF 
147                       R=175 G=175 B=255 #AFAFFF &hFFAFAF 0xFFAFAF 
148                       R=175 G=215 B=  0 #AFD700 &h00D7AF 0x00D7AF 
149                       R=175 G=215 B= 95 #AFD75F &h5FD7AF 0x5FD7AF 
150                       R=175 G=215 B=135 #AFD787 &h87D7AF 0x87D7AF 
151                       R=175 G=215 B=175 #AFD7AF &hAFD7AF 0xAFD7AF 
152                       R=175 G=215 B=215 #AFD7D7 &hD7D7AF 0xD7D7AF 
153                       R=175 G=215 B=255 #AFD7FF &hFFD7AF 0xFFD7AF 
154                       R=175 G=255 B=  0 #AFFF00 &h00FFAF 0x00FFAF 
155                       R=175 G=255 B= 95 #AFFF5F &h5FFFAF 0x5FFFAF 
156                       R=175 G=255 B=135 #AFFF87 &h87FFAF 0x87FFAF 
157                       R=175 G=255 B=175 #AFFFAF &hAFFFAF 0xAFFFAF 
158                       R=175 G=255 B=215 #AFFFD7 &hD7FFAF 0xD7FFAF 
159                       R=175 G=255 B=255 #AFFFFF &hFFFFAF 0xFFFFAF 
160                       R=215 G=  0 B=  0 #D70000 &h0000D7 0x0000D7 
161                       R=215 G=  0 B= 95 #D7005F &h5F00D7 0x5F00D7 
162                       R=215 G=  0 B=135 #D70087 &h8700D7 0x8700D7 
163                       R=215 G=  0 B=175 #D700AF &hAF00D7 0xAF00D7 
164                       R=215 G=  0 B=215 #D700D7 &hD700D7 0xD700D7 
165                       R=215 G=  0 B=255 #D700FF &hFF00D7 0xFF00D7 
166                       R=215 G= 95 B=  0 #D75F00 &h005FD7 0x005FD7 
167                       R=215 G= 95 B= 95 #D75F5F &h5F5FD7 0x5F5FD7 
168                       R=215 G= 95 B=135 #D75F87 &h875FD7 0x875FD7 
169                       R=215 G= 95 B=175 #D75FAF &hAF5FD7 0xAF5FD7 
170                       R=215 G= 95 B=215 #D75FD7 &hD75FD7 0xD75FD7 
171                       R=215 G= 95 B=255 #D75FFF &hFF5FD7 0xFF5FD7 
172                       R=215 G=135 B=  0 #D78700 &h0087D7 0x0087D7 
173                       R=215 G=135 B= 95 #D7875F &h5F87D7 0x5F87D7 
174                       R=215 G=135 B=135 #D78787 &h8787D7 0x8787D7 
175                       R=215 G=135 B=175 #D787AF &hAF87D7 0xAF87D7 
176                       R=215 G=135 B=215 #D787D7 &hD787D7 0xD787D7 
177                       R=215 G=135 B=255 #D787FF &hFF87D7 0xFF87D7 
178                       R=215 G=175 B=  0 #D7AF00 &h00AFD7 0x00AFD7 
179                       R=215 G=175 B= 95 #D7AF5F &h5FAFD7 0x5FAFD7 
180                       R=215 G=175 B=135 #D7AF87 &h87AFD7 0x87AFD7 
181                       R=215 G=175 B=175 #D7AFAF &hAFAFD7 0xAFAFD7 
182                       R=215 G=175 B=215 #D7AFD7 &hD7AFD7 0xD7AFD7 
183                       R=215 G=175 B=255 #D7AFFF &hFFAFD7 0xFFAFD7 
184                       R=215 G=215 B=  0 #D7D700 &h00D7D7 0x00D7D7 
185                       R=215 G=215 B= 95 #D7D75F &h5FD7D7 0x5FD7D7 
186                       R=215 G=215 B=135 #D7D787 &h87D7D7 0x87D7D7 
187                       R=215 G=215 B=175 #D7D7AF &hAFD7D7 0xAFD7D7 
188                       R=215 G=215 B=215 #D7D7D7 &hD7D7D7 0xD7D7D7 
189                       R=215 G=215 B=255 #D7D7FF &hFFD7D7 0xFFD7D7 
190                       R=215 G=255 B=  0 #D7FF00 &h00FFD7 0x00FFD7 
191                       R=215 G=255 B= 95 #D7FF5F &h5FFFD7 0x5FFFD7 
192                       R=215 G=255 B=135 #D7FF87 &h87FFD7 0x87FFD7 
193                       R=215 G=255 B=175 #D7FFAF &hAFFFD7 0xAFFFD7 
194                       R=215 G=255 B=215 #D7FFD7 &hD7FFD7 0xD7FFD7 
195                       R=215 G=255 B=255 #D7FFFF &hFFFFD7 0xFFFFD7 
196 (red)                 R=255 G=  0 B=  0 #FF0000 &h0000FF 0x0000FF 
197                       R=255 G=  0 B= 95 #FF005F &h5F00FF 0x5F00FF 
198                       R=255 G=  0 B=135 #FF0087 &h8700FF 0x8700FF 
199                       R=255 G=  0 B=175 #FF00AF &hAF00FF 0xAF00FF 
200                       R=255 G=  0 B=215 #FF00D7 &hD700FF 0xD700FF 
201 (magenta, fuchsia)    R=255 G=  0 B=255 #FF00FF &hFF00FF 0xFF00FF 
202                       R=255 G= 95 B=  0 #FF5F00 &h005FFF 0x005FFF 
203                       R=255 G= 95 B= 95 #FF5F5F &h5F5FFF 0x5F5FFF 
204                       R=255 G= 95 B=135 #FF5F87 &h875FFF 0x875FFF 
205                       R=255 G= 95 B=175 #FF5FAF &hAF5FFF 0xAF5FFF 
206                       R=255 G= 95 B=215 #FF5FD7 &hD75FFF 0xD75FFF 
207                       R=255 G= 95 B=255 #FF5FFF &hFF5FFF 0xFF5FFF 
208                       R=255 G=135 B=  0 #FF8700 &h0087FF 0x0087FF 
209                       R=255 G=135 B= 95 #FF875F &h5F87FF 0x5F87FF 
210                       R=255 G=135 B=135 #FF8787 &h8787FF 0x8787FF 
211                       R=255 G=135 B=175 #FF87AF &hAF87FF 0xAF87FF 
212                       R=255 G=135 B=215 #FF87D7 &hD787FF 0xD787FF 
213                       R=255 G=135 B=255 #FF87FF &hFF87FF 0xFF87FF 
214                       R=255 G=175 B=  0 #FFAF00 &h00AFFF 0x00AFFF 
215                       R=255 G=175 B= 95 #FFAF5F &h5FAFFF 0x5FAFFF 
216                       R=255 G=175 B=135 #FFAF87 &h87AFFF 0x87AFFF 
217                       R=255 G=175 B=175 #FFAFAF &hAFAFFF 0xAFAFFF 
218                       R=255 G=175 B=215 #FFAFD7 &hD7AFFF 0xD7AFFF 
219                       R=255 G=175 B=255 #FFAFFF &hFFAFFF 0xFFAFFF 
220 (gold)                R=255 G=215 B=  0 #FFD700 &h00D7FF 0x00D7FF 
221                       R=255 G=215 B= 95 #FFD75F &h5FD7FF 0x5FD7FF 
222                       R=255 G=215 B=135 #FFD787 &h87D7FF 0x87D7FF 
223                       R=255 G=215 B=175 #FFD7AF &hAFD7FF 0xAFD7FF 
224                       R=255 G=215 B=215 #FFD7D7 &hD7D7FF 0xD7D7FF 
225                       R=255 G=215 B=255 #FFD7FF &hFFD7FF 0xFFD7FF 
226 (yellow)              R=255 G=255 B=  0 #FFFF00 &h00FFFF 0x00FFFF 
227                       R=255 G=255 B= 95 #FFFF5F &h5FFFFF 0x5FFFFF 
228                       R=255 G=255 B=135 #FFFF87 &h87FFFF 0x87FFFF 
229                       R=255 G=255 B=175 #FFFFAF &hAFFFFF 0xAFFFFF 
230                       R=255 G=255 B=215 #FFFFD7 &hD7FFFF 0xD7FFFF 
231 (white)               R=255 G=255 B=255 #FFFFFF &hFFFFFF 0xFFFFFF 


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #31 on Sat 07 Apr 2007 03:26 AM (UTC)
Message
Quote:

(quoting myself)

Another site I came across seems to suggest that the colours *should* be evenly spaced in the colour cube, by an amount of 42.5 (ie. 256 / 6) rather than the spacing given on the page above.


Of course, this is nonsense because it should really be 255/5 (51) rather than 42.5. That way the range is 0x00 to 0xFF in even increments.

That is, this algorithm:


  for (red = 0; red < 6; red++)
      for (green = 0; green < 6; green++)
        for (blue = 0; blue < 6; blue++)
           xterm_256_colours [16 + (red * 36) + (blue * 6) + green] =
              RGB (red * 51, blue * 51, green * 51);


That gives this result:


16 (black)                R=  0 G=  0 B=  0 #000000 &h000000 0x000000 
17                        R=  0 G=  0 B= 51 #000033 &h330000 0x330000 
18                        R=  0 G=  0 B=102 #000066 &h660000 0x660000 
19                        R=  0 G=  0 B=153 #000099 &h990000 0x990000 
20                        R=  0 G=  0 B=204 #0000CC &hCC0000 0xCC0000 
21 (blue)                 R=  0 G=  0 B=255 #0000FF &hFF0000 0xFF0000 
22                        R=  0 G= 51 B=  0 #003300 &h003300 0x003300 
23                        R=  0 G= 51 B= 51 #003333 &h333300 0x333300 
24                        R=  0 G= 51 B=102 #003366 &h663300 0x663300 
25                        R=  0 G= 51 B=153 #003399 &h993300 0x993300 
26                        R=  0 G= 51 B=204 #0033CC &hCC3300 0xCC3300 
27                        R=  0 G= 51 B=255 #0033FF &hFF3300 0xFF3300 
28                        R=  0 G=102 B=  0 #006600 &h006600 0x006600 
29                        R=  0 G=102 B= 51 #006633 &h336600 0x336600 
30                        R=  0 G=102 B=102 #006666 &h666600 0x666600 
31                        R=  0 G=102 B=153 #006699 &h996600 0x996600 
32                        R=  0 G=102 B=204 #0066CC &hCC6600 0xCC6600 
33                        R=  0 G=102 B=255 #0066FF &hFF6600 0xFF6600 
34                        R=  0 G=153 B=  0 #009900 &h009900 0x009900 
35                        R=  0 G=153 B= 51 #009933 &h339900 0x339900 
36                        R=  0 G=153 B=102 #009966 &h669900 0x669900 
37                        R=  0 G=153 B=153 #009999 &h999900 0x999900 
38                        R=  0 G=153 B=204 #0099CC &hCC9900 0xCC9900 
39                        R=  0 G=153 B=255 #0099FF &hFF9900 0xFF9900 
40                        R=  0 G=204 B=  0 #00CC00 &h00CC00 0x00CC00 
41                        R=  0 G=204 B= 51 #00CC33 &h33CC00 0x33CC00 
42                        R=  0 G=204 B=102 #00CC66 &h66CC00 0x66CC00 
43                        R=  0 G=204 B=153 #00CC99 &h99CC00 0x99CC00 
44                        R=  0 G=204 B=204 #00CCCC &hCCCC00 0xCCCC00 
45                        R=  0 G=204 B=255 #00CCFF &hFFCC00 0xFFCC00 
46 (lime)                 R=  0 G=255 B=  0 #00FF00 &h00FF00 0x00FF00 
47                        R=  0 G=255 B= 51 #00FF33 &h33FF00 0x33FF00 
48                        R=  0 G=255 B=102 #00FF66 &h66FF00 0x66FF00 
49                        R=  0 G=255 B=153 #00FF99 &h99FF00 0x99FF00 
50                        R=  0 G=255 B=204 #00FFCC &hCCFF00 0xCCFF00 
51 (cyan, aqua)           R=  0 G=255 B=255 #00FFFF &hFFFF00 0xFFFF00 
52                        R= 51 G=  0 B=  0 #330000 &h000033 0x000033 
53                        R= 51 G=  0 B= 51 #330033 &h330033 0x330033 
54                        R= 51 G=  0 B=102 #330066 &h660033 0x660033 
55                        R= 51 G=  0 B=153 #330099 &h990033 0x990033 
56                        R= 51 G=  0 B=204 #3300CC &hCC0033 0xCC0033 
57                        R= 51 G=  0 B=255 #3300FF &hFF0033 0xFF0033 
58                        R= 51 G= 51 B=  0 #333300 &h003333 0x003333 
59                        R= 51 G= 51 B= 51 #333333 &h333333 0x333333 
60                        R= 51 G= 51 B=102 #333366 &h663333 0x663333 
61                        R= 51 G= 51 B=153 #333399 &h993333 0x993333 
62                        R= 51 G= 51 B=204 #3333CC &hCC3333 0xCC3333 
63                        R= 51 G= 51 B=255 #3333FF &hFF3333 0xFF3333 
64                        R= 51 G=102 B=  0 #336600 &h006633 0x006633 
65                        R= 51 G=102 B= 51 #336633 &h336633 0x336633 
66                        R= 51 G=102 B=102 #336666 &h666633 0x666633 
67                        R= 51 G=102 B=153 #336699 &h996633 0x996633 
68                        R= 51 G=102 B=204 #3366CC &hCC6633 0xCC6633 
69                        R= 51 G=102 B=255 #3366FF &hFF6633 0xFF6633 
70                        R= 51 G=153 B=  0 #339900 &h009933 0x009933 
71                        R= 51 G=153 B= 51 #339933 &h339933 0x339933 
72                        R= 51 G=153 B=102 #339966 &h669933 0x669933 
73                        R= 51 G=153 B=153 #339999 &h999933 0x999933 
74                        R= 51 G=153 B=204 #3399CC &hCC9933 0xCC9933 
75                        R= 51 G=153 B=255 #3399FF &hFF9933 0xFF9933 
76                        R= 51 G=204 B=  0 #33CC00 &h00CC33 0x00CC33 
77                        R= 51 G=204 B= 51 #33CC33 &h33CC33 0x33CC33 
78                        R= 51 G=204 B=102 #33CC66 &h66CC33 0x66CC33 
79                        R= 51 G=204 B=153 #33CC99 &h99CC33 0x99CC33 
80                        R= 51 G=204 B=204 #33CCCC &hCCCC33 0xCCCC33 
81                        R= 51 G=204 B=255 #33CCFF &hFFCC33 0xFFCC33 
82                        R= 51 G=255 B=  0 #33FF00 &h00FF33 0x00FF33 
83                        R= 51 G=255 B= 51 #33FF33 &h33FF33 0x33FF33 
84                        R= 51 G=255 B=102 #33FF66 &h66FF33 0x66FF33 
85                        R= 51 G=255 B=153 #33FF99 &h99FF33 0x99FF33 
86                        R= 51 G=255 B=204 #33FFCC &hCCFF33 0xCCFF33 
87                        R= 51 G=255 B=255 #33FFFF &hFFFF33 0xFFFF33 
88                        R=102 G=  0 B=  0 #660000 &h000066 0x000066 
89                        R=102 G=  0 B= 51 #660033 &h330066 0x330066 
90                        R=102 G=  0 B=102 #660066 &h660066 0x660066 
91                        R=102 G=  0 B=153 #660099 &h990066 0x990066 
92                        R=102 G=  0 B=204 #6600CC &hCC0066 0xCC0066 
93                        R=102 G=  0 B=255 #6600FF &hFF0066 0xFF0066 
94                        R=102 G= 51 B=  0 #663300 &h003366 0x003366 
95                        R=102 G= 51 B= 51 #663333 &h333366 0x333366 
96                        R=102 G= 51 B=102 #663366 &h663366 0x663366 
97                        R=102 G= 51 B=153 #663399 &h993366 0x993366 
98                        R=102 G= 51 B=204 #6633CC &hCC3366 0xCC3366 
99                        R=102 G= 51 B=255 #6633FF &hFF3366 0xFF3366 
100                       R=102 G=102 B=  0 #666600 &h006666 0x006666 
101                       R=102 G=102 B= 51 #666633 &h336666 0x336666 
102                       R=102 G=102 B=102 #666666 &h666666 0x666666 
103                       R=102 G=102 B=153 #666699 &h996666 0x996666 
104                       R=102 G=102 B=204 #6666CC &hCC6666 0xCC6666 
105                       R=102 G=102 B=255 #6666FF &hFF6666 0xFF6666 
106                       R=102 G=153 B=  0 #669900 &h009966 0x009966 
107                       R=102 G=153 B= 51 #669933 &h339966 0x339966 
108                       R=102 G=153 B=102 #669966 &h669966 0x669966 
109                       R=102 G=153 B=153 #669999 &h999966 0x999966 
110                       R=102 G=153 B=204 #6699CC &hCC9966 0xCC9966 
111                       R=102 G=153 B=255 #6699FF &hFF9966 0xFF9966 
112                       R=102 G=204 B=  0 #66CC00 &h00CC66 0x00CC66 
113                       R=102 G=204 B= 51 #66CC33 &h33CC66 0x33CC66 
114                       R=102 G=204 B=102 #66CC66 &h66CC66 0x66CC66 
115                       R=102 G=204 B=153 #66CC99 &h99CC66 0x99CC66 
116                       R=102 G=204 B=204 #66CCCC &hCCCC66 0xCCCC66 
117                       R=102 G=204 B=255 #66CCFF &hFFCC66 0xFFCC66 
118                       R=102 G=255 B=  0 #66FF00 &h00FF66 0x00FF66 
119                       R=102 G=255 B= 51 #66FF33 &h33FF66 0x33FF66 
120                       R=102 G=255 B=102 #66FF66 &h66FF66 0x66FF66 
121                       R=102 G=255 B=153 #66FF99 &h99FF66 0x99FF66 
122                       R=102 G=255 B=204 #66FFCC &hCCFF66 0xCCFF66 
123                       R=102 G=255 B=255 #66FFFF &hFFFF66 0xFFFF66 
124                       R=153 G=  0 B=  0 #990000 &h000099 0x000099 
125                       R=153 G=  0 B= 51 #990033 &h330099 0x330099 
126                       R=153 G=  0 B=102 #990066 &h660099 0x660099 
127                       R=153 G=  0 B=153 #990099 &h990099 0x990099 
128                       R=153 G=  0 B=204 #9900CC &hCC0099 0xCC0099 
129                       R=153 G=  0 B=255 #9900FF &hFF0099 0xFF0099 
130                       R=153 G= 51 B=  0 #993300 &h003399 0x003399 
131                       R=153 G= 51 B= 51 #993333 &h333399 0x333399 
132                       R=153 G= 51 B=102 #993366 &h663399 0x663399 
133                       R=153 G= 51 B=153 #993399 &h993399 0x993399 
134                       R=153 G= 51 B=204 #9933CC &hCC3399 0xCC3399 
135                       R=153 G= 51 B=255 #9933FF &hFF3399 0xFF3399 
136                       R=153 G=102 B=  0 #996600 &h006699 0x006699 
137                       R=153 G=102 B= 51 #996633 &h336699 0x336699 
138                       R=153 G=102 B=102 #996666 &h666699 0x666699 
139                       R=153 G=102 B=153 #996699 &h996699 0x996699 
140                       R=153 G=102 B=204 #9966CC &hCC6699 0xCC6699 
141                       R=153 G=102 B=255 #9966FF &hFF6699 0xFF6699 
142                       R=153 G=153 B=  0 #999900 &h009999 0x009999 
143                       R=153 G=153 B= 51 #999933 &h339999 0x339999 
144                       R=153 G=153 B=102 #999966 &h669999 0x669999 
145                       R=153 G=153 B=153 #999999 &h999999 0x999999 
146                       R=153 G=153 B=204 #9999CC &hCC9999 0xCC9999 
147                       R=153 G=153 B=255 #9999FF &hFF9999 0xFF9999 
148                       R=153 G=204 B=  0 #99CC00 &h00CC99 0x00CC99 
149                       R=153 G=204 B= 51 #99CC33 &h33CC99 0x33CC99 
150                       R=153 G=204 B=102 #99CC66 &h66CC99 0x66CC99 
151                       R=153 G=204 B=153 #99CC99 &h99CC99 0x99CC99 
152                       R=153 G=204 B=204 #99CCCC &hCCCC99 0xCCCC99 
153                       R=153 G=204 B=255 #99CCFF &hFFCC99 0xFFCC99 
154                       R=153 G=255 B=  0 #99FF00 &h00FF99 0x00FF99 
155                       R=153 G=255 B= 51 #99FF33 &h33FF99 0x33FF99 
156                       R=153 G=255 B=102 #99FF66 &h66FF99 0x66FF99 
157                       R=153 G=255 B=153 #99FF99 &h99FF99 0x99FF99 
158                       R=153 G=255 B=204 #99FFCC &hCCFF99 0xCCFF99 
159                       R=153 G=255 B=255 #99FFFF &hFFFF99 0xFFFF99 
160                       R=204 G=  0 B=  0 #CC0000 &h0000CC 0x0000CC 
161                       R=204 G=  0 B= 51 #CC0033 &h3300CC 0x3300CC 
162                       R=204 G=  0 B=102 #CC0066 &h6600CC 0x6600CC 
163                       R=204 G=  0 B=153 #CC0099 &h9900CC 0x9900CC 
164                       R=204 G=  0 B=204 #CC00CC &hCC00CC 0xCC00CC 
165                       R=204 G=  0 B=255 #CC00FF &hFF00CC 0xFF00CC 
166                       R=204 G= 51 B=  0 #CC3300 &h0033CC 0x0033CC 
167                       R=204 G= 51 B= 51 #CC3333 &h3333CC 0x3333CC 
168                       R=204 G= 51 B=102 #CC3366 &h6633CC 0x6633CC 
169                       R=204 G= 51 B=153 #CC3399 &h9933CC 0x9933CC 
170                       R=204 G= 51 B=204 #CC33CC &hCC33CC 0xCC33CC 
171                       R=204 G= 51 B=255 #CC33FF &hFF33CC 0xFF33CC 
172                       R=204 G=102 B=  0 #CC6600 &h0066CC 0x0066CC 
173                       R=204 G=102 B= 51 #CC6633 &h3366CC 0x3366CC 
174                       R=204 G=102 B=102 #CC6666 &h6666CC 0x6666CC 
175                       R=204 G=102 B=153 #CC6699 &h9966CC 0x9966CC 
176                       R=204 G=102 B=204 #CC66CC &hCC66CC 0xCC66CC 
177                       R=204 G=102 B=255 #CC66FF &hFF66CC 0xFF66CC 
178                       R=204 G=153 B=  0 #CC9900 &h0099CC 0x0099CC 
179                       R=204 G=153 B= 51 #CC9933 &h3399CC 0x3399CC 
180                       R=204 G=153 B=102 #CC9966 &h6699CC 0x6699CC 
181                       R=204 G=153 B=153 #CC9999 &h9999CC 0x9999CC 
182                       R=204 G=153 B=204 #CC99CC &hCC99CC 0xCC99CC 
183                       R=204 G=153 B=255 #CC99FF &hFF99CC 0xFF99CC 
184                       R=204 G=204 B=  0 #CCCC00 &h00CCCC 0x00CCCC 
185                       R=204 G=204 B= 51 #CCCC33 &h33CCCC 0x33CCCC 
186                       R=204 G=204 B=102 #CCCC66 &h66CCCC 0x66CCCC 
187                       R=204 G=204 B=153 #CCCC99 &h99CCCC 0x99CCCC 
188                       R=204 G=204 B=204 #CCCCCC &hCCCCCC 0xCCCCCC 
189                       R=204 G=204 B=255 #CCCCFF &hFFCCCC 0xFFCCCC 
190                       R=204 G=255 B=  0 #CCFF00 &h00FFCC 0x00FFCC 
191                       R=204 G=255 B= 51 #CCFF33 &h33FFCC 0x33FFCC 
192                       R=204 G=255 B=102 #CCFF66 &h66FFCC 0x66FFCC 
193                       R=204 G=255 B=153 #CCFF99 &h99FFCC 0x99FFCC 
194                       R=204 G=255 B=204 #CCFFCC &hCCFFCC 0xCCFFCC 
195                       R=204 G=255 B=255 #CCFFFF &hFFFFCC 0xFFFFCC 
196 (red)                 R=255 G=  0 B=  0 #FF0000 &h0000FF 0x0000FF 
197                       R=255 G=  0 B= 51 #FF0033 &h3300FF 0x3300FF 
198                       R=255 G=  0 B=102 #FF0066 &h6600FF 0x6600FF 
199                       R=255 G=  0 B=153 #FF0099 &h9900FF 0x9900FF 
200                       R=255 G=  0 B=204 #FF00CC &hCC00FF 0xCC00FF 
201 (magenta, fuchsia)    R=255 G=  0 B=255 #FF00FF &hFF00FF 0xFF00FF 
202                       R=255 G= 51 B=  0 #FF3300 &h0033FF 0x0033FF 
203                       R=255 G= 51 B= 51 #FF3333 &h3333FF 0x3333FF 
204                       R=255 G= 51 B=102 #FF3366 &h6633FF 0x6633FF 
205                       R=255 G= 51 B=153 #FF3399 &h9933FF 0x9933FF 
206                       R=255 G= 51 B=204 #FF33CC &hCC33FF 0xCC33FF 
207                       R=255 G= 51 B=255 #FF33FF &hFF33FF 0xFF33FF 
208                       R=255 G=102 B=  0 #FF6600 &h0066FF 0x0066FF 
209                       R=255 G=102 B= 51 #FF6633 &h3366FF 0x3366FF 
210                       R=255 G=102 B=102 #FF6666 &h6666FF 0x6666FF 
211                       R=255 G=102 B=153 #FF6699 &h9966FF 0x9966FF 
212                       R=255 G=102 B=204 #FF66CC &hCC66FF 0xCC66FF 
213                       R=255 G=102 B=255 #FF66FF &hFF66FF 0xFF66FF 
214                       R=255 G=153 B=  0 #FF9900 &h0099FF 0x0099FF 
215                       R=255 G=153 B= 51 #FF9933 &h3399FF 0x3399FF 
216                       R=255 G=153 B=102 #FF9966 &h6699FF 0x6699FF 
217                       R=255 G=153 B=153 #FF9999 &h9999FF 0x9999FF 
218                       R=255 G=153 B=204 #FF99CC &hCC99FF 0xCC99FF 
219                       R=255 G=153 B=255 #FF99FF &hFF99FF 0xFF99FF 
220                       R=255 G=204 B=  0 #FFCC00 &h00CCFF 0x00CCFF 
221                       R=255 G=204 B= 51 #FFCC33 &h33CCFF 0x33CCFF 
222                       R=255 G=204 B=102 #FFCC66 &h66CCFF 0x66CCFF 
223                       R=255 G=204 B=153 #FFCC99 &h99CCFF 0x99CCFF 
224                       R=255 G=204 B=204 #FFCCCC &hCCCCFF 0xCCCCFF 
225                       R=255 G=204 B=255 #FFCCFF &hFFCCFF 0xFFCCFF 
226 (yellow)              R=255 G=255 B=  0 #FFFF00 &h00FFFF 0x00FFFF 
227                       R=255 G=255 B= 51 #FFFF33 &h33FFFF 0x33FFFF 
228                       R=255 G=255 B=102 #FFFF66 &h66FFFF 0x66FFFF 
229                       R=255 G=255 B=153 #FFFF99 &h99FFFF 0x99FFFF 
230                       R=255 G=255 B=204 #FFFFCC &hCCFFFF 0xCCFFFF 
231 (white)               R=255 G=255 B=255 #FFFFFF &hFFFFFF 0xFFFFFF 


That looks nice and even. Can someone rescue me from this indecision?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #32 on Sat 07 Apr 2007 03:32 AM (UTC)
Message
Various pages (see below) seem to support the notion of a colour cube that has even increments of 51 (hex 0x33) for each element in the cube.

References:

http://world.std.com/~wij/color/
http://www.webreference.com/dev/graphics/palette.html
http://www.help4web.net/webmaster/Color/ColorTables.html

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #33 on Sat 07 Apr 2007 06:11 AM (UTC)

Amended on Sat 07 Apr 2007 06:17 AM (UTC) by Nick Gammon

Message

These are the colour swatches generated with the current code (with 51 spacing as described above):

And, a smaller version without the reference numbers, which shows the colour transitions better:


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #34 on Sat 07 Apr 2007 06:23 AM (UTC)
Message
Quote:

... you would need a second "xTerm" color dialog off the one for changing ansi settings, which would bring up the palette you can edit for them all ...


I don't really see the point in editing all 256 colours. There are so many on offer that the transitions are really quite subtle (see colour swatches above). If you really want to remap them all, use the MapColour script function.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #35 on Sat 07 Apr 2007 06:38 AM (UTC)
Message
Quote:

The most common way to handle bad data, in everything I have ever used that had ANSI support, is to just throw out any codes that are invalid.


Well, does this mean:


  • Show the entire (bad) sequence as regular text, making the assumption that it is really intended to be seen.

  • Note the sequence is bad, but still hide it (ie. everything from ESC ... m), as it is clearly a control sequence, and not intended to be seen.

  • Display as much as you can (eg. my earlier example of multiple codes, some of which are good and some are bad) - in other words, skipping (and not displaying) any bad codes in the middle.

  • Process as much as you can, up to the bad code, and then ignore the rest.

  • Process as much as you can, up to the bad code, and then display the rest.


I'm a bit opposed to regarding something like ESC[48;5;101m as "bad" just because you can't process it. To display that on the screen, when it is "obviously" a control sequence, is just going to make the screen look ugly.

So, for example, if I accept ESC[48;5;101m but one day get ESC[48;6;101m I am inclined to quietly drop it (not display it) on the grounds that it some new code I don't know about, but almost certainly not something intended for the player to see.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #36 on Sat 07 Apr 2007 08:55 PM (UTC)

Amended on Sat 07 Apr 2007 09:43 PM (UTC) by Nick Gammon

Message
Ack.. Too many things to reply to. Here we go... lol

Quote:
"... and the normal ANSI part at defaults (something Mushclient already violates. lol)"

In what way?


Mushclient violates the rule of not changing the base 16 ANSI colors because we "can" already edit them. ".pal" files generally have the first 16 and the last 8? as default settings, this was a convention from the old days where the applications had to use the same color palette as the OS, so if you changed the first 16 or the grey scale either a) Your the OS would replace the images first 16 and last 8 with its standards, messing up the picture, or in more unusual cases, the applications colors would get changed to match the image (which in some cases could be very bad). So, Mushclient is violating the rules by allowing you to change those colors.

This is however irrelevant, unless someone expects those colors to be defaults and your text gets messed up somehow because of it. But if that is the case, there is nothing to prevent you from changing back to the normal set.

Quote:
I am inclined to agree with Shaun here. It is all very well wanting 500 colours in the picker, but it then gets unwieldy.

It is very easy to choose a colour like "powderblue" and then adjust the RGB sliders to modify the colour slightly, or click "other colour" to open the standard Windows colour picker, and then move the luminance slider, if you want to change the brightness of it.


Umm. Thinking more in terms of the script. If you want "powderblue4", you can't tell it, "Use powderblue, but make it X% darker." You would have to return the actual RGB color for it, break that into its components, calculate the darker/lighter color, glue the conponents back together, then send that result to through the colornote command. One way to make it less unwieldy in the picker would be to just add a check box that would sort through the colors and only show the "main" set. I.e., anything that showed up as "powderblue(n)" would be tossed, giving the original list. And one of the most frustrating problems I had when looking for a color value was trying to remember what I used some place else. Sure, you can look through your code. Sure, you can look through the main world to see what you set an alternate color to, sure, you can "find" it, but it would be a lot easier to find if it either already had, or you could give it a name.

I remember, for example, that the "Brown" definition in POVRay never looked right, it was more red than it should have been. Maybe someone *wants* to use that color so would call it "MyBrown", just as about 90% of us added a "MyBrown" or "TrueBrown" definition to the file to fix it. (The original ran on the Commodore Amiga, and apparently something odd about the hardware meant that what we see as a correct brown color looked too green, so they had to originally make it more red to compensate.)

Quote:
Vim is a text editor which is Vi IMproved. The .vim files are colour schemes for the editor. The screenshot just above all the .vim files is a screenshot of someone using vim to edit some code.


Thanks. I did look at the files and did mention that I suspected this was the case. The page it was on wasn't, like most that assume you know what the files do already, too specific about that.

Quote:
* Show the entire (bad) sequence as regular text, making the assumption that it is really intended to be seen.

* Note the sequence is bad, but still hide it (ie. everything from ESC ... m), as it is clearly a control sequence, and not intended to be seen.

* Display as much as you can (eg. my earlier example of multiple codes, some of which are good and some are bad) - in other words, skipping (and not displaying) any bad codes in the middle.

* Process as much as you can, up to the bad code, and then ignore the rest.

* Process as much as you can, up to the bad code, and then display the rest.


In my experience, going clear back to BBSes, its more or less something between all 4. If something went screwy with a sequence like "esc[32;1;194mesc[45;0m" and you ended up with "[32;1mesc[45;qm" The result would be: "[32;1mm", since the second set would be seen, but do to the incorrect termination, processing ends the moment it hits the bad data, taking the offending invalid character with it. I think it ignores numbers though, so you could do something like esc[32;5;4;99;5;6m and it would just throw out the invalid values, but if a character landed in there some place, instead of a number, it would immediately terminate, usually only doing what that final character specified, so "m" sets a color, while "s" would "only" do what that character designates. The only source I have is, I think, is in ML for DOS3.3 or something and there is no telling if MS followed spec either. lol
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #37 on Sat 07 Apr 2007 09:08 PM (UTC)
Message
Umm. Note, I think your example of "ESC[48;6;101m" will still set the color, but it would ignore the "blink: rapid" command in the middle. XTerms color implimenation actually only works because most implimentations allow "ESC[n[;k]m", but ignore cases of "ESC[n[;k][;k]...m" There is nothing in the spec specifically preventing that, but I don't think ANSI.SYS allowed it and I don't know of any other that did either. The page on wikipedia for it

http://en.wikipedia.org/wiki/ANSI_escape_code

gives a mess of totally unsupported codes, of which ANSI in most clients will probably only support the same subset as ANSI.SYS did. Its a throwback to when some applications required that to be installed for color support to work in text clients for DOS and BBSes. A lot of stuff in telnet game clients are throwbacks to those days.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #38 on Sat 07 Apr 2007 09:45 PM (UTC)
Message
Quote:

You would have to return the actual RGB color for it, break that into its components, calculate the darker/lighter color, glue the conponents back together, then send that result to through the colornote command.


See: http://www.gammon.com.au/scripts/doc.php?function=AdjustColour

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #39 on Sat 07 Apr 2007 09:57 PM (UTC)

Amended on Sat 07 Apr 2007 10:02 PM (UTC) by Shaun Biggs

Message
Quote:
Mushclient violates the rule of not changing the base 16 ANSI colors because we "can" already edit them. ".pal" files generally have the first 16 and the last 8? as default settings, this was a convention from the old days where the applications had to use the same color palette as the OS, so if you changed the first 16 or the grey scale either a) Your the OS would replace the images first 16 and last 8 with its standards, messing up the picture, or in more unusual cases, the applications colors would get changed to match the image (which in some cases could be very bad). So, Mushclient is violating the rules by allowing you to change those colors.

So are you suggesting a regression here? The reason that MUSHclient does not violate ANSI standards for this is because MC will display whatever colour the colour codes said to. You can alter how these codes look, similar to changing the palate 15 years ago. If you want to have them go back to a standard definition, there is a button in the ANSI colour section to allow you to go back to the normal colours.

Quote:
Umm. Thinking more in terms of the script. If you want "powderblue4", you can't tell it, "Use powderblue, but make it X% darker." You would have to return the actual RGB color for it, break that into its components, calculate the darker/lighter color, glue the conponents back together, then send that result to through the colornote command.

So when I use the hexadecimal codes or use AdjustColour for ColourNote, what exactly am I doing? Am I just wasting typing and not changing the colour displayed at all? I could have sworn that works in all of my plugins, including the one that uses this to have gradients in the colour displayed in a line of text. Must be my imagination.


And once again, I have to mention that MUSHclient is open source. If you feel this strongly about something that the main developer does not agree with, start coding.

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #40 on Sat 07 Apr 2007 10:13 PM (UTC)
Message
Quote:

Mushclient violates the rule of not changing the base 16 ANSI colors ...


Ah, I thought you were going to object I didn't have the right codes for the 16 base colours.




I know this is now a long thread, but two things I wanted to check are:


  1. Are we agreed that the 6x6x6 colour cube is the correct one? The one shown most recently, with a gap of 51 between each RGB value?

  2. Are we agreed that if the "inverse" attribute is currently set, then the set foreground/background sense is reversed (see earlier post).


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #41 on Sat 07 Apr 2007 10:35 PM (UTC)
Message
Quote:

At least one Linux/Unix based list of web colors I found included about 4-5 times as many, since it allowed for things like "Light Rose 2", "Light Rose", "Dark Rose 2" and "Dark Rose", instead of just "Rose", or even Light and Dark versions only.


I should point out also that, AFAIK, zMUD has MXP support for the exact same list of colours as MUSHclient, and I don't want to encourage a "client war" where multiple clients all support different colour names, and thus MUD developers aren't sure which colours they can safely use when writing MXP. At least, at present, any colour in the MUSHclient colour picker should be supported.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #42 on Sat 07 Apr 2007 10:53 PM (UTC)

Amended on Sat 07 Apr 2007 11:00 PM (UTC) by Nick Gammon

Message
For the benefit of other client developers, here is the code I eventually used to generate all 256 entries:


// defines in case you are not using Windows:

// typedef unsigned long  COLORREF;
// typedef unsigned char  BYTE;
// typedef unsigned short WORD;
// #define RGB(r,g,b)  ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16)))
 

COLORREF xterm_256_colours [256];


void Generate256colours (void)
  {

  // standard 16 ANSI colours

  xterm_256_colours   [0] = RGB (0, 0, 0);         // (black)       
  xterm_256_colours   [1] = RGB (128, 0, 0);       // (maroon)      
  xterm_256_colours   [2] = RGB (0, 128, 0);       // (green)       
  xterm_256_colours   [3] = RGB (128, 128, 0);     // (olive)       
  xterm_256_colours   [4] = RGB (0, 0, 128);       // (navy)        
  xterm_256_colours   [5] = RGB (128, 0, 128);     // (purple)      
  xterm_256_colours   [6] = RGB (0, 128, 128);     // (teal)        
  xterm_256_colours   [7] = RGB (192, 192, 192);   // (silver)      
                       
  xterm_256_colours   [8]  = RGB (128, 128, 128);  // (gray)                 
  xterm_256_colours   [9]  = RGB (255, 0, 0);      // (red)               
  xterm_256_colours   [10] = RGB (0, 255, 0);      // (lime)              
  xterm_256_colours   [11] = RGB (255, 255, 0);    // (yellow)            
  xterm_256_colours   [12] = RGB (0, 0, 255);      // (blue)              
  xterm_256_colours   [13] = RGB (255, 0, 255);    // (magenta)  
  xterm_256_colours   [14] = RGB (0, 255, 255);    // (cyan)        
  xterm_256_colours   [15] = RGB (255, 255, 255);  // (white)             

// This gives even 6x6x6 colour cube
//  there are 6 colours in the cube, but only 5 gaps:
//   Thus the colours will be: 0x00 / 0x33 / 0x66 / 0x99 / 0xCC / 0xFF

  const BYTE colour_increment = 255 / 5;     // that is, 51 (0x33)

  int red, green, blue;

  for (red = 0; red < 6; red++)
      for (green = 0; green < 6; green++)
        for (blue = 0; blue < 6; blue++)
           xterm_256_colours [16 + (red * 36) + (blue * 6) + green] =
              RGB (red   * colour_increment, 
                   blue  * colour_increment, 
                   green * colour_increment);


  // finish off with 24 greyscale colours  

  int grey;
  for (grey = 0; grey < 24; grey++)
    {
    BYTE value = 8 + (grey * 10);
    xterm_256_colours [232 + grey] = RGB (value, value, value);
    }

  } // end of Generate256colours


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #43 on Sat 07 Apr 2007 11:13 PM (UTC)

Amended on Sun 08 Apr 2007 09:03 PM (UTC) by Nick Gammon

Message
Quote:
So are you suggesting a regression here?


No, I just mentioned that based on the way palettes where normally handled, it violated the standard, not that we should revert it. Sheesh...

Quote:
So when I use the hexadecimal codes or use AdjustColour for ColourNote, what exactly am I doing? Am I just wasting typing and not changing the colour displayed at all?



Moved discussion about custom colours to:


http://www.gammon.com.au/forum/?id=7775


- Nick Gammon
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #44 on Sat 07 Apr 2007 11:37 PM (UTC)
Message
Quote:
Its not like, if you allowed naming of user customized colors, that those would be supported in MXP either, it just makes it easier to use the name given to them, rather than trying to remember the hex codes.

So it's easier to remember a whole bunch of different names for colours? I personally would find that much more difficult to do. If you want to add in the colour names to plugins, just define them in the plugin.

<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE muclient[
  <!ENTITY player_name 
   "Balaam" >
  <!ENTITY info_colour
   "11" >
]>


These are the first 7 lines of a plugin I made to keep track of player kills. I put in entities so that people could change their name and the colour which they preferred for display. Every time the player's name is in a trigger, &player_name is substituted so that the triggers don't have to be changed one by one for everyone using the script.

It is much easier to fight for one's ideals than to live up to them.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


159,137 views.

This is page 3, subject is 4 pages long:  [Previous page]  1  2  3 4  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.