diff options
| author | Dan Halbert <halbert@adafruit.com> | 2019-07-22 22:30:28 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-22 22:30:28 -0400 |
| commit | 82ab998cd591bc8a4dea45e4ee0baf3601819834 (patch) | |
| tree | 3394297eb9729a925108c436767a9655d925a487 /supervisor/shared | |
| parent | 7cb2aa2d62d37c3faeec4c52b2e4d3ecdc29b60e (diff) | |
| parent | 1d1b8703b6c108b72a1abda9312646895f542672 (diff) | |
Merge pull request #1998 from tannewt/monocolor
Add support for grayscale displays
Diffstat (limited to 'supervisor/shared')
| -rw-r--r-- | supervisor/shared/display.c | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index 414f85034..6a39cbe8e 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -82,8 +82,7 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { grid->pixel_height = height_in_tiles * grid->tile_height; grid->tiles = tiles; - supervisor_terminal.cursor_x = 0; - supervisor_terminal.cursor_y = 0; + common_hal_terminalio_terminal_construct(&supervisor_terminal, grid, &supervisor_terminal_font); } void supervisor_stop_terminal(void) { @@ -147,17 +146,49 @@ displayio_bitmap_t blinka_bitmap = { .read_only = true }; -uint32_t blinka_transparency[1] = {0x80000000}; - -// These colors are RGB 565 with the bytes swapped. -uint32_t blinka_colors[8] = {0x78890000, 0x9F86B8FC, 0xffff0D5A, 0x0000f501, - 0x00000000, 0x00000000, 0x00000000, 0x00000000}; +_displayio_color_t blinka_colors[7] = { + { + .rgb888 = 0x000000, + .rgb565 = 0x0000, + .luma = 0x00, + .transparent = true + }, + { + .rgb888 = 0x8428bc, + .rgb565 = 0x7889, + .luma = 0xff // We cheat the luma here. It is actually 0x60 + }, + { + .rgb888 = 0xff89bc, + .rgb565 = 0xB8FC, + .luma = 0xb5 + }, + { + .rgb888 = 0x7beffe, + .rgb565 = 0x9F86, + .luma = 0xe0 + }, + { + .rgb888 = 0x51395f, + .rgb565 = 0x0D5A, + .luma = 0x47 + }, + { + .rgb888 = 0xffffff, + .rgb565 = 0xffff, + .luma = 0xff + }, + { + .rgb888 = 0x0736a0, + .rgb565 = 0xf501, + .luma = 0x44 + }, +}; displayio_palette_t blinka_palette = { .base = {.type = &displayio_palette_type }, - .opaque = blinka_transparency, .colors = blinka_colors, - .color_count = 16, + .color_count = 7, .needs_refresh = false }; |
