Surreptitiously add 24-color support

box-drawing
cpsdqs 7 years ago
parent af723bf783
commit 61953f608e
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 22
      js/term/screen_parser.js

@ -306,13 +306,13 @@ module.exports = class ScreenParser {
break break
case SEQ_SET_COLORS: case SEQ_SET_COLORS:
data = strArray[ci++].codePointAt(0) - 1 data = du(strArray[ci++])
fg = data & 0xFF fg = data & 0xFF
bg = (data >> 8) & 0xFF bg = (data >> 8) & 0xFF
break break
case SEQ_SET_ATTRS: case SEQ_SET_ATTRS:
data = strArray[ci++].codePointAt(0) - 1 data = du(strArray[ci++])
attrs = data & 0xFFFF attrs = data & 0xFFFF
break break
@ -321,13 +321,23 @@ module.exports = class ScreenParser {
break break
case SEQ_SET_FG: case SEQ_SET_FG:
data = strArray[ci++].codePointAt(0) - 1 data = du(strArray[ci++])
fg = data & 0xFF if (data & 0x10000) {
data ^= 0x10000
data |= du(strArray[ci++]) << 12
data += 256
}
fg = data
break break
case SEQ_SET_BG: case SEQ_SET_BG:
data = strArray[ci++].codePointAt(0) - 1 data = du(strArray[ci++])
bg = data & 0xFF if (data & 0x10000) {
data ^= 0x10000
data |= du(strArray[ci++]) << 12
data += 256
}
bg = data
break break
default: default:

Loading…
Cancel
Save