diff --git a/halyde/apps/rtest.lua b/halyde/apps/rtest.lua index afc9993..9f065f0 100644 --- a/halyde/apps/rtest.lua +++ b/halyde/apps/rtest.lua @@ -1,6 +1,5 @@ local raster = import("raster") -local ANSIColorPallete = import("halyde.core.termlib.lua").ANSIColorPalette -raster.drawPixel(4, 3, ANSIColorPallete["bright"][3]) -raster.drawPixel(40, 34, nil, ANSIColorPallete["bright"][4]) +raster.drawPixel(4, 3, 0xFFFF00) +raster.drawPixel(40, 34, nil, 0xFF00FF) raster.drawPixel(3, 3) \ No newline at end of file diff --git a/halyde/lib/raster.lua b/halyde/lib/raster.lua index 4d27acb..5a9a89f 100644 --- a/halyde/lib/raster.lua +++ b/halyde/lib/raster.lua @@ -7,9 +7,20 @@ function mergePixels(x, y, bg, fg) local original = gpu.get(x, y)[0] if bg ~= nil then gpu.setBackground(bg) end if fg ~= nil then gpu.setForeground(fg) end - + -- convert from braille to char code + -- convert from + -- 1 4 1 2 + -- 2 5 -> 3 4 + -- 3 6 5 6 + -- 7 8 7 8 using complicate bit thingery + -- bitwise or + -- unconvert + -- print the thing end function XY2Braille(x, y) return math.floor(x/2), math.floor(y/4) +end +function Braille2XY(x, y) + return math.floor(x*2), math.floor(y*4) end \ No newline at end of file