2017-09-25 08:23:24 -07:00
|
|
|
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
|
2017-09-26 03:03:09 -07:00
|
|
|
BACKLIGHT_NORMAL = const(150)
|
2017-09-25 08:23:24 -07:00
|
|
|
BACKLIGHT_DIM = const(5)
|
|
|
|
BACKLIGHT_NONE = const(2)
|
|
|
|
BACKLIGHT_MAX = const(255)
|
|
|
|
|
2017-09-26 03:03:09 -07:00
|
|
|
# color palette
|
2018-01-11 10:46:49 -08:00
|
|
|
RED = rgb(0xFF, 0x00, 0x00)
|
2017-09-25 08:23:24 -07:00
|
|
|
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)
|
2018-01-11 10:46:49 -08:00
|
|
|
GREEN = rgb(0x00, 0xAE, 0x0B)
|
2017-09-25 08:23:24 -07:00
|
|
|
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)
|
|
|
|
LIGHT_GREY = rgb(0xDA, 0xDD, 0xD8)
|
|
|
|
GREY = rgb(0x9E, 0x9E, 0x9E)
|
|
|
|
DARK_GREY = rgb(0x3E, 0x3E, 0x3E)
|
|
|
|
BLUE_GRAY = rgb(0x60, 0x7D, 0x8B)
|
|
|
|
BLACK = rgb(0x00, 0x00, 0x00)
|
|
|
|
WHITE = rgb(0xFA, 0xFA, 0xFA)
|
2017-11-03 09:14:01 -07:00
|
|
|
BLACKISH = rgb(0x30, 0x30, 0x30)
|
|
|
|
|
|
|
|
TITLE_GREY = rgb(0x9B, 0x9B, 0x9B)
|
|
|
|
ORANGE_ICON = rgb(0xF5, 0xA6, 0x23)
|
2017-09-26 03:03:09 -07:00
|
|
|
|
|
|
|
# common color styles
|
|
|
|
BG = BLACK
|
|
|
|
FG = WHITE
|
2017-09-25 08:23:24 -07:00
|
|
|
|
|
|
|
# icons
|
2018-02-26 14:00:50 -08:00
|
|
|
ICON_DEFAULT = 'trezor/res/header_icons/reset.toig'
|
2017-09-25 08:23:24 -07:00
|
|
|
ICON_RESET = 'trezor/res/header_icons/reset.toig'
|
|
|
|
ICON_WIPE = 'trezor/res/header_icons/wipe.toig'
|
2018-01-11 10:46:49 -08:00
|
|
|
ICON_RECOVERY = 'trezor/res/recovery.toig'
|
|
|
|
ICON_CLEAR = 'trezor/res/cross2.toig'
|
|
|
|
ICON_CONFIRM = 'trezor/res/confirm2.toig'
|
|
|
|
ICON_CONFIRM2 = 'trezor/res/confirm.toig'
|
2017-09-26 08:05:53 -07:00
|
|
|
ICON_LOCK = 'trezor/res/lock.toig'
|
2017-11-03 09:14:01 -07:00
|
|
|
ICON_CLICK = 'trezor/res/click.toig'
|
2018-01-11 10:46:49 -08:00
|
|
|
ICON_BACK = 'trezor/res/left.toig'
|
2018-01-16 08:48:06 -08:00
|
|
|
ICON_NOCOPY = 'trezor/res/nocopy.toig'
|
2018-01-17 08:42:55 -08:00
|
|
|
ICON_SWIPE = 'trezor/res/swipedown.toig'
|
2018-01-23 06:06:10 -08:00
|
|
|
ICON_CHECK = 'trezor/res/check.toig'
|
2018-02-11 05:09:54 -08:00
|
|
|
ICON_SPACE = 'trezor/res/space.toig'
|
2017-09-25 08:23:24 -07:00
|
|
|
|
|
|
|
# buttons
|
|
|
|
BTN_DEFAULT = {
|
2018-01-23 05:18:13 -08:00
|
|
|
'normal': {
|
|
|
|
'bg-color': BG,
|
|
|
|
'fg-color': FG,
|
|
|
|
'text-style': NORMAL,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
},
|
|
|
|
'active': {
|
|
|
|
'bg-color': FG,
|
|
|
|
'fg-color': BG,
|
|
|
|
'text-style': BOLD,
|
|
|
|
'border-color': FG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
},
|
|
|
|
'disabled': {
|
|
|
|
'bg-color': BG,
|
|
|
|
'fg-color': GREY,
|
|
|
|
'text-style': NORMAL,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
}
|
2017-09-25 08:23:24 -07:00
|
|
|
}
|
2018-01-23 05:18:13 -08:00
|
|
|
|
2017-09-25 08:23:24 -07:00
|
|
|
BTN_CANCEL = {
|
2018-01-23 05:18:13 -08:00
|
|
|
'normal': {
|
|
|
|
'bg-color': RED,
|
|
|
|
'fg-color': FG,
|
|
|
|
'text-style': BOLD,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
},
|
|
|
|
'active': {
|
|
|
|
'bg-color': FG,
|
|
|
|
'fg-color': RED,
|
|
|
|
'text-style': BOLD,
|
|
|
|
'border-color': FG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
},
|
|
|
|
'disabled': {
|
|
|
|
'bg-color': BG,
|
|
|
|
'fg-color': GREY,
|
|
|
|
'text-style': NORMAL,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
}
|
2017-09-25 08:23:24 -07:00
|
|
|
}
|
2018-01-23 05:18:13 -08:00
|
|
|
|
2017-09-25 08:23:24 -07:00
|
|
|
BTN_CONFIRM = {
|
2018-01-23 05:18:13 -08:00
|
|
|
'normal': {
|
|
|
|
'bg-color': GREEN,
|
|
|
|
'fg-color': FG,
|
|
|
|
'text-style': BOLD,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
},
|
|
|
|
'active': {
|
|
|
|
'bg-color': FG,
|
|
|
|
'fg-color': GREEN,
|
|
|
|
'text-style': BOLD,
|
|
|
|
'border-color': FG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
},
|
|
|
|
'disabled': {
|
|
|
|
'bg-color': BG,
|
|
|
|
'fg-color': GREY,
|
|
|
|
'text-style': NORMAL,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
}
|
2017-09-25 08:23:24 -07:00
|
|
|
}
|
2018-01-23 05:18:13 -08:00
|
|
|
|
2017-09-25 08:23:24 -07:00
|
|
|
BTN_CLEAR = {
|
2018-01-23 05:18:13 -08:00
|
|
|
'normal': {
|
|
|
|
'bg-color': ORANGE,
|
|
|
|
'fg-color': FG,
|
|
|
|
'text-style': NORMAL,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
},
|
|
|
|
'active': {
|
|
|
|
'bg-color': BG,
|
|
|
|
'fg-color': GREY,
|
|
|
|
'text-style': NORMAL,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
},
|
|
|
|
'disabled': {
|
|
|
|
'bg-color': BG,
|
|
|
|
'fg-color': GREY,
|
|
|
|
'text-style': MONO,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
}
|
2017-09-25 08:23:24 -07:00
|
|
|
}
|
2018-01-23 05:18:13 -08:00
|
|
|
|
2017-09-25 08:23:24 -07:00
|
|
|
BTN_KEY = {
|
2018-01-23 05:18:13 -08:00
|
|
|
'normal': {
|
|
|
|
'bg-color': BLACKISH,
|
|
|
|
'fg-color': FG,
|
|
|
|
'text-style': MONO,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
},
|
|
|
|
'active': {
|
|
|
|
'bg-color': FG,
|
|
|
|
'fg-color': BLACKISH,
|
|
|
|
'text-style': MONO,
|
|
|
|
'border-color': FG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
},
|
|
|
|
'disabled': {
|
|
|
|
'bg-color': BG,
|
|
|
|
'fg-color': GREY,
|
|
|
|
'text-style': MONO,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
}
|
2017-11-03 09:14:01 -07:00
|
|
|
}
|
2017-09-25 08:23:24 -07:00
|
|
|
|
2018-02-07 10:48:32 -08:00
|
|
|
BTN_KEY_CONFIRM = {
|
|
|
|
'normal': {
|
|
|
|
'bg-color': GREEN,
|
|
|
|
'fg-color': FG,
|
|
|
|
'text-style': MONO,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
},
|
|
|
|
'active': {
|
|
|
|
'bg-color': FG,
|
|
|
|
'fg-color': GREEN,
|
|
|
|
'text-style': MONO,
|
|
|
|
'border-color': FG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
},
|
|
|
|
'disabled': {
|
|
|
|
'bg-color': BG,
|
|
|
|
'fg-color': GREY,
|
|
|
|
'text-style': MONO,
|
|
|
|
'border-color': BG,
|
|
|
|
'radius': RADIUS,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-25 08:23:24 -07:00
|
|
|
# loader
|
|
|
|
LDR_DEFAULT = {
|
2018-01-23 05:18:13 -08:00
|
|
|
'normal': {
|
|
|
|
'bg-color': BG,
|
|
|
|
'fg-color': GREEN,
|
|
|
|
'icon': None,
|
|
|
|
'icon-fg-color': None,
|
|
|
|
},
|
|
|
|
'active': {
|
|
|
|
'bg-color': BG,
|
|
|
|
'fg-color': GREEN,
|
2018-01-23 06:06:10 -08:00
|
|
|
'icon': ICON_CHECK,
|
2018-01-23 05:18:13 -08:00
|
|
|
'icon-fg-color': WHITE,
|
|
|
|
}
|
2017-09-25 08:23:24 -07:00
|
|
|
}
|
2018-01-23 05:18:13 -08:00
|
|
|
|
|
|
|
LDR_DANGER = {
|
|
|
|
'normal': {
|
|
|
|
'bg-color': BG,
|
|
|
|
'fg-color': RED,
|
|
|
|
'icon': None,
|
|
|
|
'icon-fg-color': None,
|
|
|
|
},
|
|
|
|
'active': {
|
|
|
|
'bg-color': BG,
|
|
|
|
'fg-color': RED,
|
2018-01-23 06:06:10 -08:00
|
|
|
'icon': ICON_CHECK,
|
2018-01-23 05:18:13 -08:00
|
|
|
'icon-fg-color': WHITE,
|
|
|
|
}
|
2017-09-25 08:23:24 -07:00
|
|
|
}
|