Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
watch-my-terminal.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b7343be
)
fix palette, go bright on bold
author
Jason Woofenden
<jason@jasonwoof.com>
Wed, 30 Jan 2013 20:44:14 +0000
(15:44 -0500)
committer
Jason Woofenden
<jason@jasonwoof.com>
Wed, 30 Jan 2013 20:44:14 +0000
(15:44 -0500)
index.html
patch
|
blob
|
history
diff --git
a/index.html
b/index.html
index
718479e
..
e70dfc7
100644
(file)
--- a/
index.html
+++ b/
index.html
@@
-6,26
+6,40
@@
<script src="/socket.io/socket.io.js"></script>
<script>
$(function() {
<script src="/socket.io/socket.io.js"></script>
<script>
$(function() {
+ // 8-14 are bolded versions
var palette = [
'2e3436',
var palette = [
'2e3436',
- 'a40000',
+ 'cc0000',
'4e9a06',
'c4a000',
'3465a4',
'75507b',
'4e9a06',
'c4a000',
'3465a4',
'75507b',
- 'ce5c00',
- 'babdb6',
+ '06989a',
+ 'd3d7cf',
+ '555753',
+ 'ef2929',
+ '8ae234',
+ 'fce94f',
+ '729fcf',
+ 'ad7fa8',
+ '34e2e2',
+ 'eeeeec'
];
var $body = $('body');
var socket = io.connect('http://localhost');
var color_to_css = function(i) {
];
var $body = $('body');
var socket = io.connect('http://localhost');
var color_to_css = function(i) {
- return 'color: #' + palette[i] + '; ';
+ index = i & 0xff
+ // lighten the basic 8 colors when they're bold
+ if (i & 0x10000 && index < 8) {
+ index += 8;
+ }
+ return 'color: #' + palette[index] + '; ';
}
var bg_color_to_css = function(i) {
}
var bg_color_to_css = function(i) {
- return 'background-' + color_to_css(i);
+ return 'background-' + color_to_css((i&0x10000) | ((i&0xff00) >> 8));
}
var stylize = function (txt, style) {
}
var stylize = function (txt, style) {
- if(txt.length == 0 || style == 0) {
+ if (txt.length == 0 || style == 0) {
return txt
}
css = ''
return txt
}
css = ''
@@
-33,8
+47,8
@@
if(style & 0x20000) css += 'text-decoration: underline; ';
if(style & 0x40000) css += 'text-decoration: underline; '; // blink
if(style & 0x80000) css += 'text-decoration: line-through; '; // invisible
if(style & 0x20000) css += 'text-decoration: underline; ';
if(style & 0x40000) css += 'text-decoration: underline; '; // blink
if(style & 0x80000) css += 'text-decoration: line-through; '; // invisible
- if(style & 0x000ff) css += color_to_css(style & 0xff);
- if(style & 0x0ff00) css += bg_color_to_css((style & 0xff00) >> 8);
+ if(style & 0x000ff) css += color_to_css(style);
+ if(style & 0x0ff00) css += bg_color_to_css(style);
return $('<span style="'+css+'"></span>').text(txt);
}
socket.on('init', function (v) {
return $('<span style="'+css+'"></span>').text(txt);
}
socket.on('init', function (v) {
@@
-63,7
+77,7
@@
</script>
<style>
body {
</script>
<style>
body {
- color: #babdb6;
+ color: #d3d7cf;
background: #2e3436;
font-family: monospace;
font-size: 12px;
background: #2e3436;
font-family: monospace;
font-size: 12px;