From d738122ca55ca84998d5f94410723991c381b85f Mon Sep 17 00:00:00 2001 From: boxgaming <75969133+boxgaming@users.noreply.github.com> Date: Fri, 11 Oct 2024 06:49:16 -0500 Subject: [PATCH] Updated screen function to return background color when applicable --- qb.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qb.js b/qb.js index a115163..6fa09bd 100644 --- a/qb.js +++ b/qb.js @@ -3385,7 +3385,17 @@ var QB = new function() { if (!cdata) { return 0; } var c = cdata.fgcolor; if (!c) { return 0; } - return _lookupIndexedColor(c); + console.log(cdata.bgcolor); + c = _lookupIndexedColor(c); + if (!isNaN(c)) { + if (c < 16) { + var bg = _lookupIndexedColor(cdata.bgcolor); + if (!isNaN(bg) && bg > 0 && bg <= 7) { + c += bg*16; + } + } + } + return c; } function _lookupIndexedColor(c) {