neolee / SCU

SCU (Squirrel 配置工具)
613 stars 48 forks source link

自定义皮肤背景和颜色都变成黑色。 #1

Closed sfufoet closed 11 years ago

sfufoet commented 11 years ago

我的皮肤代码

文件是 squirrel.custom.yaml

代码如下

weasel.custom.yaml

patch: style/horizontal: true # 候選橫排

style/inline_preedit: true  # 內嵌編碼(僅支持TSF)

style/corner_radius: 4       # 窗口圓角半徑

style/color_scheme: sfufoet      # 選擇配色方案

app_options/com.alfredapp.Alfred: {}    # 开启 Alfred 的中文输入

"style/color_scheme": sfufoet    # 這項用於選中下面定義的新方案
"preset_color_schemes/sfufoet":  # 在配色方案列表裏加入標識爲 starcraft 的新方案
  name: sfufoet
  author: sfufoet <sfufoet@gmail.com>
  text_color: 0x000000              # 編碼行文字顏色,24位色值,用十六進制書寫方便些,順序是藍綠紅0xBBGGRR
  candidate_text_color: 0x000000   # 候選項文字顏色,當與文字顏色不同時指定
  back_color: 0xdfdfde             # 底色
  border_color: 0xdfdfdf           # 邊框顏色,與底色相同則爲無邊框的效果
  hilited_text_color: 0xdd6d2a     # 高亮文字,即與當前高亮候選對應的那部份輸入碼
  hilited_back_color: 0xdfdfde     # 設定高亮文字的底色,可起到凸顯高亮部份的作用
  hilited_candidate_text_color: 0xdd6d2a  # 高亮候選項的文字顏色,要醒目!
  hilited_candidate_back_color: 0xdfdfde  # 高亮候選項的底色,若與背景色不同就會顯出光棒

该死的 Markdown 语法。。。你懂的。

neolee commented 11 years ago

@sfufoet:

这个问题的本质是 rime / Squirrel 的配置文件中将颜色值都作为字符串处理,而我的配置工具中读到 0xffffff 这样的值会将其看作数字,所以最简单的解决方案是在你的 squirrel.custom.yaml 文件中将自定义配色方案里的颜色值都用引号括起来强制为字符串。

SCU Issue 1

UPDATE: 另一个 workaround 见下佛振大大的说明。

lotem commented 11 years ago

RGBA(, , *, 0) 是全透明,RGB(0, 0, 0) 是黑色,相當於 RGBA(0, 0, 0, 255)。如果用數值,則不透明色最高位的 0xff 不能省略。