mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-24 03:30:40 +02:00
* Fix MCI colors. Everything working well so far!
This commit is contained in:
parent
23a4344a4b
commit
04c85d2311
8 changed files with 142 additions and 95 deletions
|
@ -326,16 +326,35 @@ function sgr() {
|
|||
|
||||
//
|
||||
// Converts a Graphic Rendition object used elsewhere
|
||||
// to a ANSI SGR sequence
|
||||
// to a ANSI SGR sequence.
|
||||
//
|
||||
function getSGRFromGraphicRendition(graphicRendition) {
|
||||
var sgrSeq = graphicRendition.styles.slice(0); // start out with styles
|
||||
function getSGRFromGraphicRendition(graphicRendition, initialReset) {
|
||||
var sgrSeq = [];
|
||||
|
||||
var styleCount = 0;
|
||||
[ 'intensity', 'underline', 'blink', 'negative', 'invisible' ].forEach(function style(s) {
|
||||
if(graphicRendition[s]) {
|
||||
sgrSeq.push(graphicRendition[s]);
|
||||
++styleCount;
|
||||
}
|
||||
});
|
||||
|
||||
if(!styleCount) {
|
||||
sgrSeq.push(0);
|
||||
}
|
||||
|
||||
if(graphicRendition.fg) {
|
||||
sgrSeq.push(graphicRendition.fg);
|
||||
}
|
||||
|
||||
if(graphicRendition.bg) {
|
||||
sgrSeq.push(graphicRendition.bg);
|
||||
}
|
||||
|
||||
if(initialReset) {
|
||||
sgrSeq.unshift(0);
|
||||
}
|
||||
|
||||
return sgr(sgrSeq);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue