diff --git a/frontend/apps/reader/modules/readercropping.lua b/frontend/apps/reader/modules/readercropping.lua index c5a75b490..9e44df430 100644 --- a/frontend/apps/reader/modules/readercropping.lua +++ b/frontend/apps/reader/modules/readercropping.lua @@ -93,7 +93,7 @@ function ReaderCropping:onPageCrop(mode) self.orig_view_dimen = Geom:new{w = self.view.dimen.w, h = self.view.dimen.h} -- backup original view bgcolor self.orig_view_bgcolor = self.view.outer_page_color - self.view.outer_page_color = Blitbuffer.gray(0.5) -- gray bgcolor + self.view.outer_page_color = Blitbuffer.COLOR_GREY -- backup original page scroll self.orig_page_scroll = self.view.page_scroll self.view.page_scroll = false diff --git a/frontend/apps/reader/modules/readerview.lua b/frontend/apps/reader/modules/readerview.lua index bd8c36927..b6e793699 100644 --- a/frontend/apps/reader/modules/readerview.lua +++ b/frontend/apps/reader/modules/readerview.lua @@ -43,7 +43,7 @@ local ReaderView = OverlapGroup:new{ page_gap = { width = Screen:scaleBySize(8), height = Screen:scaleBySize(8), - color = Blitbuffer.gray(0.5), + color = Blitbuffer.COLOR_GREY, }, -- DjVu page rendering mode (used in djvu.c:drawPage()) render_mode = DRENDER_MODE, -- default to COLOR diff --git a/frontend/ui/widget/button.lua b/frontend/ui/widget/button.lua index 9c106b8f7..1977c31f0 100644 --- a/frontend/ui/widget/button.lua +++ b/frontend/ui/widget/button.lua @@ -35,7 +35,7 @@ function Button:init() if self.text then self.label_widget = TextWidget:new{ text = self.text, - fgcolor = Blitbuffer.gray(self.enabled and 1.0 or 0.5), + fgcolor = self.enabled and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_GREY, bold = self.text_font_bold, face = Font:getFace(self.text_font_face, self.text_font_size) } @@ -114,7 +114,11 @@ end function Button:enable() self.enabled = true if self.text then - self.label_widget.fgcolor = Blitbuffer.gray(self.enabled and 1.0 or 0.5) + if self.enabled then + self.label_widget.fgcolor = Blitbuffer.COLOR_BLACK + else + self.label_widget.fgcolor = Blitbuffer.COLOR_GREY + end else self.label_widget.dim = not self.enabled end @@ -123,7 +127,11 @@ end function Button:disable() self.enabled = false if self.text then - self.label_widget.fgcolor = Blitbuffer.gray(self.enabled and 1.0 or 0.5) + if self.enabled then + self.label_widget.fgcolor = Blitbuffer.COLOR_BLACK + else + self.label_widget.fgcolor = Blitbuffer.COLOR_GREY + end else self.label_widget.dim = not self.enabled end diff --git a/frontend/ui/widget/buttontable.lua b/frontend/ui/widget/buttontable.lua index b3002dd6d..5ec6c453e 100644 --- a/frontend/ui/widget/buttontable.lua +++ b/frontend/ui/widget/buttontable.lua @@ -55,7 +55,7 @@ function ButtonTable:init() } local button_dim = button:getSize() local vertical_sep = LineWidget:new{ - background = Blitbuffer.gray(0.5), + background = Blitbuffer.COLOR_GREY, dimen = Geom:new{ w = self.sep_width, h = button_dim.h, @@ -85,7 +85,7 @@ function ButtonTable:addHorizontalSep() table.insert(self.container, VerticalSpan:new{ width = Screen:scaleBySize(2) }) table.insert(self.container, LineWidget:new{ - background = Blitbuffer.gray(0.5), + background = Blitbuffer.COLOR_GREY, dimen = Geom:new{ w = self.width, h = self.sep_width, diff --git a/frontend/ui/widget/dictquicklookup.lua b/frontend/ui/widget/dictquicklookup.lua index d27aa6438..5088a9879 100644 --- a/frontend/ui/widget/dictquicklookup.lua +++ b/frontend/ui/widget/dictquicklookup.lua @@ -212,7 +212,6 @@ function DictQuickLookup:update() show_parent = self, } local title_bar = LineWidget:new{ - --background = Blitbuffer.gray(0.5), dimen = Geom:new{ w = button_table:getSize().w + self.button_padding, h = Screen:scaleBySize(2), diff --git a/frontend/ui/widget/inputtext.lua b/frontend/ui/widget/inputtext.lua index d4755382c..2de3bd35d 100644 --- a/frontend/ui/widget/inputtext.lua +++ b/frontend/ui/widget/inputtext.lua @@ -113,7 +113,7 @@ function InputText:initTextBox(text) bordersize = self.bordersize, padding = self.padding, margin = self.margin, - color = Blitbuffer.gray(self.focused and 1.0 or 0.5), + color = self.focused and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_GREY, self.text_widget, } self.dimen = self[1]:getSize() @@ -138,7 +138,7 @@ end function InputText:unfocus() self.focused = false self.text_widget:unfocus() - self[1].color = Blitbuffer.gray(0.5) + self[1].color = Blitbuffer.COLOR_GREY end function InputText:focus() diff --git a/frontend/ui/widget/linkbox.lua b/frontend/ui/widget/linkbox.lua index 1b4c6829e..3dec77834 100644 --- a/frontend/ui/widget/linkbox.lua +++ b/frontend/ui/widget/linkbox.lua @@ -8,7 +8,7 @@ local Blitbuffer = require("ffi/blitbuffer") local LinkBox = InputContainer:new{ box = nil, - color = Blitbuffer.gray(0.5), + color = Blitbuffer.COLOR_GREY, radius = 0, bordersize = 2, } diff --git a/frontend/ui/widget/toggleswitch.lua b/frontend/ui/widget/toggleswitch.lua index 79419f20d..bce536629 100644 --- a/frontend/ui/widget/toggleswitch.lua +++ b/frontend/ui/widget/toggleswitch.lua @@ -28,7 +28,7 @@ local ToggleSwitch = InputContainer:new{ width = Screen:scaleBySize(216), height = Screen:scaleBySize(30), bgcolor = Blitbuffer.COLOR_WHITE, -- unfoused item color - fgcolor = Blitbuffer.gray(0.5), -- focused item color + fgcolor = Blitbuffer.COLOR_GREY, -- focused item color font_face = "cfont", font_size = 16, enabled = true, @@ -42,7 +42,7 @@ function ToggleSwitch:init() self.toggle_frame = FrameContainer:new{ background = Blitbuffer.COLOR_WHITE, - color = Blitbuffer.gray(0.5), + color = Blitbuffer.COLOR_GREY, radius = 7, bordersize = 1, padding = 2, @@ -70,7 +70,7 @@ function ToggleSwitch:init() } local button = FrameContainer:new{ background = Blitbuffer.COLOR_WHITE, - color = Blitbuffer.gray(0.5), + color = Blitbuffer.COLOR_GREY, margin = 0, radius = 5, bordersize = 1, diff --git a/frontend/ui/widget/touchmenu.lua b/frontend/ui/widget/touchmenu.lua index 88ca06b0f..a3fd72f19 100644 --- a/frontend/ui/widget/touchmenu.lua +++ b/frontend/ui/widget/touchmenu.lua @@ -79,7 +79,7 @@ function TouchMenuItem:init() }, TextWidget:new{ text = self.item.text or self.item.text_func(), - fgcolor = Blitbuffer.gray(item_enabled ~= false and 1.0 or 0.5), + fgcolor = item_enabled ~= false and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_GREY, face = self.face, }, },