Update watch face: modular refactor + OWM/Solar/background + codegen tools

- Split render into FieldTable/Fields/Icons/Layout/Settings modules
- Add Fenix8V3Background, Owm (weather), Solar modules
- Add tools/ generators (gen_fields/gen_icons/gen_themes/gen_preview_svg)
- Tune README/manifest/strings/settings
This commit is contained in:
2026-09-10 07:10:55 +08:00
parent 52346bdd09
commit 4d96ab0912
23 changed files with 1549 additions and 344 deletions

View File

@@ -1,28 +1,27 @@
#!/usr/bin/env python3
"""Generate source/Themes.mc from the design kit in design/.
"""从 design/ 的设计稿生成 source/Themes.mc
Ground truth is the seven watchface-NN-*.svg files (produced by design/rebuild.py
from the original raster comps). Every colour written to Themes.mc is measured
from those files -- nothing here is hand-picked.
事实来源是七个 watchface-NN-*.svg原作者用 design/rebuild.py 从位图逆向出来的)。
写进 Themes.mc 的每一个颜色都是从这些文件里**量出来的**,没有一个是手挑的。
python3 tools/gen_themes.py
Extracted per theme:
每套主题提取出:
ringTop[21] lit colour of each top tick, index 0 = 6.5 deg .. 20 = 86.5 deg
ringBottom[21] lit colour of each bottom tick, index 0 = 6.0 deg .. 20 = 66.0 deg
tickOff colour of an unlit tick
anchorDot the four dots between the arcs
bandFill/Text date band background / foreground
colon the two colon blocks
hours[11] vertical gradient ramp of the hour digits, top -> bottom
minutes[11] ditto for the minute digits
accent icons and DST/STEP labels
textPrimary complication and bottom-row values
ringTop[21] 顶弧每根刻度点亮时的颜色,下标 0 = 6.5°,20 = 86.5°
ringBottom[21] 底弧每根刻度点亮时的颜色,下标 0 = 6.0°,20 = 66.0°
tickOff 未点亮刻度的颜色
anchorDot 四段弧之间的锚点圆点
bandFill/Text 日期带的底色 / 文字色
colon 两块冒号
hours[11] 小时数字的竖向渐变,从上到下
minutes[11] 分钟数字的竖向渐变
accent 图标与 DST/STEP 标签
textPrimary 各数据位与底部行的数值
Only 14 of the 21 bottom ticks are lit in any comp, so indices 14..20 of
ringBottom are extrapolated (least-squares fit over the last 8 measured ticks).
Those ticks only appear once a metric passes ~67%.
⚠️ 已知近似:设计稿里底弧最多只点亮 14/21 根,所以 ringBottom 的第 1521 项
无法实测,由最后 8 根做最小二乘线性外推得到。只有当指标超过约 67% 时才会
显示这几根。
"""
import os
import re
@@ -160,11 +159,20 @@ def fmt_list(colours, indent):
def main():
themes = [read_theme(t) for t in ORDER]
L = []
L.append("// AUTO-GENERATED by tools/gen_themes.py from design/watchface-*.svg.")
L.append("// Do not edit by hand -- change the design kit and re-run the generator.")
L.append("// ⚠️ 本文件由 tools/gen_themes.py design/watchface-*.svg 自动生成,请勿手改。")
L.append("// 要改配色就改设计稿里的 SVG然后重新跑一遍生成器。")
L.append("//")
L.append("// ringTop/ringBottom lit colour per tick, index 0 nearest 12 / 6 o'clock")
L.append("// hours/minutes 11-stop vertical gradient of the time digits, top -> bottom")
L.append("// 七套主题的全部颜色数据。各数组的下标就是主题序号0=Ember … 6=Kelp")
L.append("//")
L.append("// RINGTOP/RINGBOTTOM 每根刻度点亮时的颜色,各 21 项。")
L.append("// 下标 0 是最靠近 12 点 / 6 点的那根。")
L.append("// 这是从设计稿里**逐根取样**的实测值,不是插值近似。")
L.append("// HOURS/MINUTES 时间数字的竖向渐变,各 11 个停止点,从上到下。")
L.append("// TICKOFF 未点亮刻度的颜色")
L.append("// ANCHORDOT 四个锚点圆点")
L.append("// BANDFILL/BANDTEXT 日期带的底色 / 文字色")
L.append("// ACCENT 图标与底部标签")
L.append("// TEXTPRIMARY 各项数值")
L.append("import Toybox.Lang;")
L.append("")
L.append("module Themes {")