quick commit before wahlolly does anything
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
local raster = import("raster")
|
local raster = import("raster")
|
||||||
local ANSIColorPallete = import("halyde.core.termlib.lua").ANSIColorPalette
|
|
||||||
|
|
||||||
raster.drawPixel(4, 3, ANSIColorPallete["bright"][3])
|
raster.drawPixel(4, 3, 0xFFFF00)
|
||||||
raster.drawPixel(40, 34, nil, ANSIColorPallete["bright"][4])
|
raster.drawPixel(40, 34, nil, 0xFF00FF)
|
||||||
raster.drawPixel(3, 3)
|
raster.drawPixel(3, 3)
|
||||||
+12
-1
@@ -7,9 +7,20 @@ function mergePixels(x, y, bg, fg)
|
|||||||
local original = gpu.get(x, y)[0]
|
local original = gpu.get(x, y)[0]
|
||||||
if bg ~= nil then gpu.setBackground(bg) end
|
if bg ~= nil then gpu.setBackground(bg) end
|
||||||
if fg ~= nil then gpu.setForeground(fg) 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
|
end
|
||||||
|
|
||||||
function XY2Braille(x, y)
|
function XY2Braille(x, y)
|
||||||
return math.floor(x/2), math.floor(y/4)
|
return math.floor(x/2), math.floor(y/4)
|
||||||
|
end
|
||||||
|
function Braille2XY(x, y)
|
||||||
|
return math.floor(x*2), math.floor(y*4)
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user