From 6f3ddf630340cf23f04560e2362fc783049e0b93 Mon Sep 17 00:00:00 2001 From: Bilbard Date: Tue, 18 Aug 2026 03:25:25 -0600 Subject: [PATCH 1/5] Fix color modes --- .../gmod_wire_digitalscreen/cl_init.lua | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/lua/entities/gmod_wire_digitalscreen/cl_init.lua b/lua/entities/gmod_wire_digitalscreen/cl_init.lua index 02ca193cce..4f4233628e 100644 --- a/lua/entities/gmod_wire_digitalscreen/cl_init.lua +++ b/lua/entities/gmod_wire_digitalscreen/cl_init.lua @@ -240,16 +240,27 @@ transformcolor[0] = function(c) -- RGBXXX local crgb = math.floor(c / 1000) local cgray = c - math.floor(c / 1000)*1000 - return cgray+28*math.fmod(crgb, 10), cgray+28*math.fmod(math.floor(crgb / 10), 10), cgray+28*math.fmod(math.floor(crgb / 100), 10) + cb = cgray+28*math.fmod(crgb, 10) + cg = cgray+28*math.fmod(math.floor(crgb / 10), 10) + cr = cgray+28*math.fmod(math.floor(crgb / 100), 10) + + return cr, cg, cb + end transformcolor[2] = function(c) -- 24 bit mode - return math.fmod(c, 256), math.fmod(math.floor(c / 256), 256), math.fmod(math.floor(c / 65536), 256) + cb = math.fmod(c, 256) + cg = math.fmod(math.floor(c / 256), 256) + cr = math.fmod(math.floor(c / 65536), 256) + + return cr, cg, cb + end transformcolor[3] = function(c) -- RRRGGGBBB - return math.fmod(c, 1000), math.fmod(math.floor(c / 1e3), 1000), math.fmod(math.floor(c / 1e6), 1000) -end -transformcolor[4] = function(c) -- XXX - return c, c, c + cb = math.fmod(c, 1000) + cg = math.fmod(math.floor(c / 1e3), 1000) + cr = math.fmod(math.floor(c / 1e6), 1000) + + return cr, cg, cb end function ENT:RedrawPixel(a) From 5f86f5eee27b127757970297628e03f951f7f42b Mon Sep 17 00:00:00 2001 From: Bilbard Date: Tue, 18 Aug 2026 03:26:21 -0600 Subject: [PATCH 2/5] Formatting --- lua/entities/gmod_wire_digitalscreen/cl_init.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/lua/entities/gmod_wire_digitalscreen/cl_init.lua b/lua/entities/gmod_wire_digitalscreen/cl_init.lua index 4f4233628e..727f189fd7 100644 --- a/lua/entities/gmod_wire_digitalscreen/cl_init.lua +++ b/lua/entities/gmod_wire_digitalscreen/cl_init.lua @@ -245,7 +245,6 @@ transformcolor[0] = function(c) -- RGBXXX cr = cgray+28*math.fmod(math.floor(crgb / 100), 10) return cr, cg, cb - end transformcolor[2] = function(c) -- 24 bit mode cb = math.fmod(c, 256) @@ -253,7 +252,6 @@ transformcolor[2] = function(c) -- 24 bit mode cr = math.fmod(math.floor(c / 65536), 256) return cr, cg, cb - end transformcolor[3] = function(c) -- RRRGGGBBB cb = math.fmod(c, 1000) From 169ca77cf1106227c8026b2721e1d8dd74e6ef8b Mon Sep 17 00:00:00 2001 From: Bilbard Date: Tue, 18 Aug 2026 07:13:45 -0600 Subject: [PATCH 3/5] Real fix --- .../gmod_wire_digitalscreen/cl_init.lua | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/lua/entities/gmod_wire_digitalscreen/cl_init.lua b/lua/entities/gmod_wire_digitalscreen/cl_init.lua index 727f189fd7..1d91a52941 100644 --- a/lua/entities/gmod_wire_digitalscreen/cl_init.lua +++ b/lua/entities/gmod_wire_digitalscreen/cl_init.lua @@ -240,25 +240,13 @@ transformcolor[0] = function(c) -- RGBXXX local crgb = math.floor(c / 1000) local cgray = c - math.floor(c / 1000)*1000 - cb = cgray+28*math.fmod(crgb, 10) - cg = cgray+28*math.fmod(math.floor(crgb / 10), 10) - cr = cgray+28*math.fmod(math.floor(crgb / 100), 10) - - return cr, cg, cb + return cgray+28*math.fmod(math.floor(crgb / 100), 10), cgray+28*math.fmod(math.floor(crgb / 10), 10), cgray+28*math.fmod(crgb, 10) end transformcolor[2] = function(c) -- 24 bit mode - cb = math.fmod(c, 256) - cg = math.fmod(math.floor(c / 256), 256) - cr = math.fmod(math.floor(c / 65536), 256) - - return cr, cg, cb + return math.fmod(math.floor(c / 65536), 256), math.fmod(math.floor(c / 256), 256), math.fmod(c, 256) end transformcolor[3] = function(c) -- RRRGGGBBB - cb = math.fmod(c, 1000) - cg = math.fmod(math.floor(c / 1e3), 1000) - cr = math.fmod(math.floor(c / 1e6), 1000) - - return cr, cg, cb + return math.fmod(math.floor(c / 1e6), 1000), math.fmod(math.floor(c / 1e3), 1000), math.fmod(c, 1000) end function ENT:RedrawPixel(a) From 6d6ee4434223085ca0dceac059aedffa00502b81 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Tue, 18 Aug 2026 16:14:10 +0300 Subject: [PATCH 4/5] Fix wrong return order --- .../gmod_wire_digitalscreen/cl_init.lua | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/lua/entities/gmod_wire_digitalscreen/cl_init.lua b/lua/entities/gmod_wire_digitalscreen/cl_init.lua index 727f189fd7..1d91a52941 100644 --- a/lua/entities/gmod_wire_digitalscreen/cl_init.lua +++ b/lua/entities/gmod_wire_digitalscreen/cl_init.lua @@ -240,25 +240,13 @@ transformcolor[0] = function(c) -- RGBXXX local crgb = math.floor(c / 1000) local cgray = c - math.floor(c / 1000)*1000 - cb = cgray+28*math.fmod(crgb, 10) - cg = cgray+28*math.fmod(math.floor(crgb / 10), 10) - cr = cgray+28*math.fmod(math.floor(crgb / 100), 10) - - return cr, cg, cb + return cgray+28*math.fmod(math.floor(crgb / 100), 10), cgray+28*math.fmod(math.floor(crgb / 10), 10), cgray+28*math.fmod(crgb, 10) end transformcolor[2] = function(c) -- 24 bit mode - cb = math.fmod(c, 256) - cg = math.fmod(math.floor(c / 256), 256) - cr = math.fmod(math.floor(c / 65536), 256) - - return cr, cg, cb + return math.fmod(math.floor(c / 65536), 256), math.fmod(math.floor(c / 256), 256), math.fmod(c, 256) end transformcolor[3] = function(c) -- RRRGGGBBB - cb = math.fmod(c, 1000) - cg = math.fmod(math.floor(c / 1e3), 1000) - cr = math.fmod(math.floor(c / 1e6), 1000) - - return cr, cg, cb + return math.fmod(math.floor(c / 1e6), 1000), math.fmod(math.floor(c / 1e3), 1000), math.fmod(c, 1000) end function ENT:RedrawPixel(a) From 46af097af81770e0becad47ad02e8ab65c1efdaa Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Tue, 18 Aug 2026 16:15:10 +0300 Subject: [PATCH 5/5] Re-add this --- lua/entities/gmod_wire_digitalscreen/cl_init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/entities/gmod_wire_digitalscreen/cl_init.lua b/lua/entities/gmod_wire_digitalscreen/cl_init.lua index 1d91a52941..da411985f2 100644 --- a/lua/entities/gmod_wire_digitalscreen/cl_init.lua +++ b/lua/entities/gmod_wire_digitalscreen/cl_init.lua @@ -248,6 +248,9 @@ end transformcolor[3] = function(c) -- RRRGGGBBB return math.fmod(math.floor(c / 1e6), 1000), math.fmod(math.floor(c / 1e3), 1000), math.fmod(c, 1000) end +transformcolor[4] = function(c) -- XXX + return c, c, c +end function ENT:RedrawPixel(a) if a >= self.ScreenWidth*self.ScreenHeight then return end