screen.lua (72e39d711d5300beb8f7fa07c17c62d88e2a31b6) | screen.lua (5495d73c35a88f8e2549d641f39d89625e054e11) |
---|---|
1-- 2-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3-- 4-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org> 5-- All rights reserved. 6-- 7-- Redistribution and use in source and binary forms, with or without 8-- modification, are permitted provided that the following conditions --- 35 unchanged lines hidden (view full) --- 44function screen.setcursor(x, y) 45 if core.isSerialBoot() then 46 return 47 end 48 49 loader.printc("\027[" .. y .. ";" .. x .. "H") 50end 51 | 1-- 2-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3-- 4-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org> 5-- All rights reserved. 6-- 7-- Redistribution and use in source and binary forms, with or without 8-- modification, are permitted provided that the following conditions --- 35 unchanged lines hidden (view full) --- 44function screen.setcursor(x, y) 45 if core.isSerialBoot() then 46 return 47 end 48 49 loader.printc("\027[" .. y .. ";" .. x .. "H") 50end 51 |
52function screen.setforeground(c) | 52function screen.setforeground(color_value) |
53 if color.disabled then | 53 if color.disabled then |
54 return c | 54 return color_value |
55 end | 55 end |
56 loader.printc("\027[3" .. c .. "m") | 56 loader.printc(color.escapef(color_value)) |
57end 58 | 57end 58 |
59function screen.setbackground(c) | 59function screen.setbackground(color_value) |
60 if color.disabled then | 60 if color.disabled then |
61 return c | 61 return color_value |
62 end | 62 end |
63 loader.printc("\027[4" .. c .. "m") | 63 loader.printc(color.escapeb(color_value)) |
64end 65 66function screen.defcolor() 67 loader.printc(color.default()) 68end 69 70function screen.defcursor() 71 if core.isSerialBoot() then 72 return 73 end 74 loader.printc("\027[25;0H") 75end 76 77return screen | 64end 65 66function screen.defcolor() 67 loader.printc(color.default()) 68end 69 70function screen.defcursor() 71 if core.isSerialBoot() then 72 return 73 end 74 loader.printc("\027[25;0H") 75end 76 77return screen |