from micropython import const from trezor.ui import rgb from trezor.ui import NORMAL, BOLD, MONO # radius for buttons and other elements RADIUS = const(2) # backlight brightness BACKLIGHT_NORMAL = const(150) BACKLIGHT_DIM = const(5) BACKLIGHT_NONE = const(2) BACKLIGHT_MAX = const(255) # color palette RED = rgb(0xFF, 0x00, 0x00) PINK = rgb(0xE9, 0x1E, 0x63) PURPLE = rgb(0x9C, 0x27, 0xB0) DEEP_PURPLE = rgb(0x67, 0x3A, 0xB7) INDIGO = rgb(0x3F, 0x51, 0xB5) BLUE = rgb(0x21, 0x96, 0xF3) LIGHT_BLUE = rgb(0x03, 0xA9, 0xF4) CYAN = rgb(0x00, 0xBC, 0xD4) TEAL = rgb(0x00, 0x96, 0x88) GREEN = rgb(0x00, 0xAE, 0x0B) LIGHT_GREEN = rgb(0x87, 0xCE, 0x26) LIME = rgb(0xCD, 0xDC, 0x39) YELLOW = rgb(0xFF, 0xEB, 0x3B) AMBER = rgb(0xFF, 0xC1, 0x07) ORANGE = rgb(0xFF, 0x98, 0x00) DEEP_ORANGE = rgb(0xFF, 0x57, 0x22) BROWN = rgb(0x79, 0x55, 0x48)
from micropython import const from trezor.ui import rgb from trezor.ui import NORMAL, BOLD, MONO # radius for buttons and other elements RADIUS = const(2) # backlight brightness BACKLIGHT_NORMAL = const(150) BACKLIGHT_DIM = const(5) BACKLIGHT_NONE = const(2) BACKLIGHT_MAX = const(255) # color palette LIGHT_RED = rgb(0xFF, 0x00, 0x00) RED = rgb(0xE4, 0x57, 0x2E) # RED E4572E ACTIVE_RED = rgb(0xA6, 0x40, 0x22) # ACTIVE DARK RED A64022 PINK = rgb(0xE9, 0x1E, 0x63) PURPLE = rgb(0x9C, 0x27, 0xB0) DEEP_PURPLE = rgb(0x67, 0x3A, 0xB7) INDIGO = rgb(0x3F, 0x51, 0xB5) BLUE = rgb(0x21, 0x96, 0xF3) LIGHT_BLUE = rgb(0x03, 0xA9, 0xF4) CYAN = rgb(0x00, 0xBC, 0xD4) TEAL = rgb(0x00, 0x96, 0x88) GREEN = rgb(0x4C, 0xC1, 0x48) # GREEN 4CC148 ACTIVE_GREEN = rgb(0x1A, 0x8C, 0x14) # ACTIVE DARK GREEN 1A8C14 LIGHT_GREEN = rgb(0x87, 0xCE, 0x26) LIME = rgb(0xCD, 0xDC, 0x39) YELLOW = rgb(0xFF, 0xEB, 0x3B) AMBER = rgb(0xFF, 0xC1, 0x07)
# # 2048 Game # ported to TREZOR Core by Pavol Rusnak ([email protected]) # # inspired by https://github.com/gabrielecirulli/2048 # from trezor import loop, ui, workflow from trezor.crypto import random from trezor.ui.swipe import Swipe, SWIPE_DOWN, SWIPE_UP, SWIPE_LEFT color_fg1 = ui.rgb(0x77, 0x6E, 0x65) color_fg2 = ui.rgb(0xF9, 0xF6, 0xF2) color = { "0": (ui.rgb(0xCC, 0xC0, 0xB3), ui.rgb(0xBB, 0xAD, 0xA0)), "2": (ui.rgb(0xEE, 0xE4, 0xDA), color_fg1), "4": (ui.rgb(0xED, 0xE0, 0xC8), color_fg1), "8": (ui.rgb(0xF2, 0xB1, 0x79), color_fg2), "16": (ui.rgb(0xF5, 0x95, 0x63), color_fg2), "32": (ui.rgb(0xF6, 0x7C, 0x5F), color_fg2), "64": (ui.rgb(0xF6, 0x5E, 0x3B), color_fg2), "128": (ui.rgb(0xED, 0xCF, 0x72), color_fg2), "256": (ui.rgb(0xED, 0xCC, 0x61), color_fg2), "512": (ui.rgb(0xED, 0xC8, 0x50), color_fg2), "1024": (ui.rgb(0xED, 0xC5, 0x3F), color_fg2), "2048": (ui.rgb(0xED, 0xC2, 0x2E), color_fg2), "lose": (ui.rgb(0xFF, 0x00, 0x00), ui.rgb(0xFF, 0xFF, 0xFF)), "win": (ui.rgb(0x00, 0xFF, 0x00), ui.rgb(0xFF, 0xFF, 0xFF)), }
# # 2048 Game ported to TREZOR Core by Pavol Rusnak ([email protected]) # # inspired by https://github.com/gabrielecirulli/2048 # from trezor import ui from trezor import loop from trezor import workflow from trezor.crypto import random from trezor.ui.swipe import Swipe, SWIPE_DOWN, SWIPE_UP, SWIPE_LEFT color_bg = ui.rgb(0xbb, 0xad, 0xa0) color_empty = ui.rgb(0xcc, 0xc0, 0xb3) color_fg1 = ui.rgb(0x77, 0x6e, 0x65) color_fg2 = ui.rgb(0xf9, 0xf6, 0xf2) color_lose_fg = ui.rgb(0xff, 0xff, 0xff) color_lose_bg = ui.rgb(0xff, 0x00, 0x00) color_win_fg = ui.rgb(0xff, 0xff, 0xff) color_win_bg = ui.rgb(0x00, 0xff, 0x00) color = {} color[2] = ui.rgb(0xee, 0xe4, 0xda), color_fg1 color[4] = ui.rgb(0xed, 0xe0, 0xc8), color_fg1 color[8] = ui.rgb(0xf2, 0xb1, 0x79), color_fg2 color[16] = ui.rgb(0xf5, 0x95, 0x63), color_fg2 color[32] = ui.rgb(0xf6, 0x7c, 0x5f), color_fg2 color[64] = ui.rgb(0xf6, 0x5e, 0x3b), color_fg2 color[128] = ui.rgb(0xed, 0xcf, 0x72), color_fg2 color[256] = ui.rgb(0xed, 0xcc, 0x61), color_fg2 color[512] = ui.rgb(0xed, 0xc8, 0x50), color_fg2 color[1024] = ui.rgb(0xed, 0xc5, 0x3f), color_fg2