single repo

This commit is contained in:
Adolfo Reyna
2026-01-01 13:33:51 -05:00
parent 8b56187ef1
commit bc8ae91eba
334 changed files with 124529 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
# boolpalette.py Implement BoolPalette class
# This is a 2-value color palette for rendering monochrome glyphs to color
# FrameBuffer instances. Supports destinations with up to 16 bit color.
# Copyright (c) Peter Hinch 2021
# Released under the MIT license see LICENSE
import framebuf
class BoolPalette(framebuf.FrameBuffer):
def __init__(self, mode):
buf = bytearray(4) # OK for <= 16 bit color
super().__init__(buf, 2, 1, mode)
def fg(self, color): # Set foreground color
self.pixel(1, 0, color)
def bg(self, color):
self.pixel(0, 0, color)