From fc184ea591ddf5cfd72968ea22484bf835de8038 Mon Sep 17 00:00:00 2001 From: mcplayer3 <219271061+mcplayer3@users.noreply.github.com> Date: Sat, 20 Jun 2026 22:19:36 +1000 Subject: [PATCH] Started to add custom colour palettes I have literally no idea why it wont work but if anyone picks this up you'll know it works when the old Halyde colours show up --- halyde/config/terminal.json | 25 ++++++++++++++++++++++++- halyde/kernel/modules/terminal.lua | 12 +++--------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/halyde/config/terminal.json b/halyde/config/terminal.json index 2d43851..b57a0d0 100644 --- a/halyde/config/terminal.json +++ b/halyde/config/terminal.json @@ -1 +1,24 @@ -{"palette":{"dark":{"0":"171421","1":"c01c28","2":"26a269","3":"a2734c","4":"12488b","5":"a347ba","6":"2aa1b3","7":"d0cfcc"},"bright":{"0":"5e5c64","1":"f66151","2":"33d17a","3":"e9ad0c","4":"2a7bde","5":"c061cb","6":"33c7de","7":"ffffff"}}} \ No newline at end of file +{ + "palette": { + "dark": { + "0": "0x0f0f0f", + "1": "0xcc2424", + "2": "0x339280", + "3": "0x996d00", + "4": "0x004980", + "5": "0x9949c0", + "6": "0x33b6c0", + "7": "0xc3c3c3" + }, + "bright": { + "0": "0x666d80", + "1": "0xff6d40", + "2": "0x33db80", + "3": "0xffb600", + "4": "0x336dff", + "5": "0xcc6dc0", + "6": "0x33dbc0", + "7": "0xffffff" + } + } +} diff --git a/halyde/kernel/modules/terminal.lua b/halyde/kernel/modules/terminal.lua index c3788e8..bad0c01 100644 --- a/halyde/kernel/modules/terminal.lua +++ b/halyde/kernel/modules/terminal.lua @@ -113,7 +113,7 @@ function module.init() for i = 0, 7 do palette["bright"][i] = tonumber(config.palette.bright[tostring(i)], 16) end - require("log").terminal.info("Set colour palette: " .. serialize(palette, " ")) + require("log").terminal.info("Set color palette: " .. serialize(palette)) return palette --[[ return { ["dark"] = { @@ -170,15 +170,9 @@ function module.init() local cursor = { x = 1, y = 1, X = nil, Y = nil } -- X and Y are managed by ESC s and ESC u local printState = 0 -- 0:none 1:in ESC 2:in CSI - local color = { - FG = ANSIColorPalette["bright"][7], BG = ANSIColorPalette["dark"][0], - fg = nil, bg = nil, reverse = false - } - require("log").terminal.info("FG and BG: " .. color.FG .. " " .. color.BG) - color.fg = color.FG - color.bg = color.BG - local DEFAULT_FG = ANSIColorPalette["bright"][7] -- TODO make configurable + local DEFAULT_FG = ANSIColorPalette["bright"][7] local DEFAULT_BG = ANSIColorPalette["dark"][0] + require("log").terminal.info("FG and BG: " .. DEFAULT_FG .. " " .. DEFAULT_BG) local fg = DEFAULT_FG local bg = DEFAULT_BG local gpuFg = nil