Ronnier-skill
色彩科學/色度學完整中文學習筆記,包裝成 Claude Code skill,也支援 Codex。涵蓋 CIE 色度學、CIEDE2000、CIECAM02、色適應與演色性。
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/ayueh0102--ronnier-skill)HTML
<a href="/listings/ayueh0102--ronnier-skill"><img src="/api/listings/ayueh0102--ronnier-skill/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
These steps run a script from the network that findsafeskills does not scan.
Works with **Claude Code**, **Codex**, and anything that reads `AGENTS.md` (Cursor / Windsurf / Cline).
> **Not sure which one you're using?** [`INSTALL.md`](INSTALL.md) opens with a > quick decision table, and includes **expected output at each step** plus a > **troubleshooting section** (execution policy, skill not triggering, encoding…).
🟣 Claude Code
| Platform | Command | |---|---| | 🍎 **macOS** / 🐧 **Linux** | `curl -fsSL https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.sh \| bash` | | 🪟 **Windows** (PowerShell) | `irm https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.ps1 \| iex` |
Then open a **new** session. It loads automatically when you ask a colour science question, or invoke it with `/luo-ming-color-science`.
🟢 Codex
Same script with `--codex` — installs to `~/.colour-science` and registers it in `~/.codex/AGENTS.md`:
# macOS / Linux curl -fsSL https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.sh | bash -s -- --codex
# Windows: download first, then run with the flag irm https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.ps1 -OutFile i.ps1 ; .\i.ps1 -Codex
🔵 Cursor / Windsurf / Cline
Clone into your project, then point your rules file at it:
git clone --depth 1 https://github.com/Ayueh0102/Ronnier-skill.git .colour-science
📖 Just reading
Nothing to install — everything under `references/` is plain Markdown.
> **📘 Full instructions (manual install, updating, uninstalling, troubleshooting): [`INSTALL.md`](INSTALL.md)**
**To update**: run the install command again — it detects an existing install and pulls.
---
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
SKILL.md · Manifest · 367 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
- ---
- name: luo-ming-color-science
- description: 回答色彩科學/色度學問題時使用。涵蓋 CIE 色度學、XYZ 三刺激值、光源與色溫、色彩量測儀器與不確定度、色視覺與對立色理論、心理物理學實驗設計、色序系統(Munsell/NCS/Ostwald/DIN)、色差公式(CIELAB/CMC/CIE94/CIEDE2000)、影像色差與 S-CIELAB、同色異譜、色貌模型(CIECAM02/CAM16)、色適應變換(CAT02)、演色性(CRI/Rf/Rg)。觸發語如「色差公式」「CIEDE2000」「CIECAM02」「Munsell」「NCS」「色貌」「色適應」「演色性」「同色異譜」「亮度跟明度差在哪」「幫我複習色彩學」,或提到羅明(Ming Ronnier Luo)教授的色彩學課程。
- ---
- # Applied Color Science · 課程學習筆記
- 本 skill 是一份**色彩科學/色度學的完整學習筆記**,內容依循 **Ming Ronnier Luo(羅明)教授**
- 於 **2021 年 10/30 – 11/07** 在**台灣科技大學 色彩與照明科技研究所**開設的
- **Applied Color Science** 密集課程(11 個 Lecture)的架構與觀點整理而成。
- > **⚠️ 這是學生整理的非官方筆記,未經羅明教授審閱或背書。**
- > 內容經過查證與交叉比對,但錯誤由整理者負責,與教授本人無關。
- **本 skill 包含的是「上課筆記」本身**,不含任何課程素材。
- ---
- ## 回答問題的原則(重要)
- ### 1. 永遠分清「老師的講法」與「標準說法」
- 使用者的目的是**學會這門課**,同時**不被口誤誤導**。因此:
- - **考試 / 複習類問題** → **以老師的教材與講法為準**(他自己說過:「我回答問題會以我的課程教材為準」)
- - **做研究、寫論文、寫程式、實務應用** → **以標準說法為準**,並主動指出差異
- - 遇到已知的出入時,**明確標示**,例如:
- > 老師課堂上說 X;不過標準(CIE 13.3 / GUM / …)是 Y。考試寫 X,實作用 Y。
- **所有已知出入都整理在 `references/00-differences.md`**,分 **A–H 八類**:
- - **A 類**:明確口誤(20 項)—— 必須更正(**A12 / A13 / A16 已由投影片翻案,老師沒錯**)
- - **B 類**:教學簡化(40 項)—— 方向對但不精確
- - **C 類**:老師的研究立場(13 項)—— 教科書不一定有,但很有價值
- - **D 類**:老師沒講但實作必備的補充(30 項)
- - **E 類**:2021 年之後的發展(13 項)
- - **★ F 類**:**投影片本身印錯(20 項)** —— 老師照唸沒錯,是教材的錯。**考試照投影片寫,寫程式用正確版**
- - **★ G 類**:**投影片正確、老師口述錯(11 項)** —— **以投影片為準**
- - **★ H 類**:**只有抽投影片才拿得到、課堂錄音裡沒有的內容(3 項)**
- > ### ★★ F 類裡「會讓程式算錯」的五個,實作前務必先查
- > | # | 位置 | 投影片印的 | 正確 |
- > |---|---|---|---|
- > | **F1** | `L02_s025` 等 | `k = 100/Σ R(λ)S(λ)ȳ(λ)` | `k = 100/Σ S(λ)ȳ(λ)Δλ`(分母不含 R) |
- > | **F6** | `L11_s023` | `+0.021009V⁴` | **`−0.021009V⁴`**(`L13_s014` 印對了) |
- > | **F10** | `L12_s023` | `6.1273` | **`6.1723`**(DIN Darkness) |
- > | **F15** | `L13_s017` | `u' = 4X/(X+15Y+3)` | **`+3Z`** |
- > | **F17** | `L13_s018` | `s_uv = 13(u*²+v*²)^½` | **`13[(u'−u'ₙ)²+(v'−v'ₙ)²]^½`** |
- ### 2. 有一批專有名詞特別容易聽錯/寫錯
- 色彩科學有不少名詞在中文語境下極易誤植(Hunt→Hound、MacAdam→McArden、Ostwald→Osterwee、metamerism→metamorphism、CIEDE2000→CIEP 2000…)。
- **看到可疑的寫法先查 `references/00-glossary.md` 第二部分的對照總表。**
- **最容易踩的陷阱:CIELAB 與 CIELUV 常被混成同一個詞**,必須靠上下文分辨。
- ### ★★ 2b. 使用者講「亮度」「明度」「彩度」時,先確認他指的是哪一個
- **中文在這裡的詞彙比英文少很多,同一個詞會對應到好幾個完全不同的量。**
- ```
- 「亮度」 → Luminance(cd/m²,物理)? Brightness(明亮度,知覺)? 還是 Lightness(明度)?
- 「彩度」 → Chroma(÷ 白的亮度)? 還是 NCS 的 chromaticness?
- 「色度」 → Chromaticity(座標)—— ★ 不是「彩度」,只差一個字但完全不同
- ```
- **遇到這類詞,先查 `references/00-terminology-traps.md`。**
- **如果從上下文判斷不出來,就在回答裡把兩種可能都點出來** ——
- 這比猜錯一路講下去好,而且**辨異本身就是很好的教學**。
- **★ 最該優先建立的兩把刀**(那份檔案的核心):
- ```
- 第一刀:物理量(儀器量得到,有單位) vs 知覺量(只能問人,沒單位)
- 第二刀:絕對量(Q, M,燈亮就變大) vs 相對量(J, C,除以參考白)
- ```
- ### 3. ★★★ 出處是給你查證用的,不是給學生看的 —— **直接回答,不要從投影片開始**
- **這個 skill 的使用者是「要學會這門課的學生」,不是「要核對教材的助教」。**
- ```
- ❌ 不要這樣開場:
- 「投影片 L13_s044「Five Corrections to CIELAB」原文:… 」
- 「根據 references/L13 第 7 節… 」
- 「這在第 13 講第 7 節… 」
- ✅ 要這樣開場:
- 「CIELAB 有五個地方會出問題,CIEDE2000 就是針對這五個地方各打一針。」
- (先講「這是什麼、為什麼存在」,直接進入內容)
- ```
- **出處要不要給?**
- | 情況 | 怎麼做 |
- |---|---|
- | **一般教學、回答問題** | **不提投影片編號、不提檔名、不提章節** —— 直接講內容 |
- | 使用者問「這哪來的 / 老師哪裡講的」 | **這時才給**課堂時間碼與教材位置 |
- | 使用者在**核對筆記、做校訂**(像建這個 skill 的那種工作) | 給完整出處 |
- | 提到 **A/F/G 類的出入**時 | **要說「老師課堂上說 X、標準是 Y」,但不必說是第幾張投影片** |
- **時間碼的用法**:筆記裡有課堂時間碼,學生想回頭查時很有用。
- **要給就放在答案最後,不要放在最前面。**
- ---
- ### 3b. ★★★ 用老師的方式教,不要用教科書的方式教
- **老師的教學順序是固定的,照著走:**
- ```
- ① 先講「產業出了什麼問題」 ← 一個真實的痛點、一個故事
- ② 再問「所以我們需要什麼?」 ← 把需求講清楚
- ③ 給一個生活化的比喻建立直覺 ← 讓人「看見」那個概念
- ④ 這時才給精確定義與公式 ← 學生已經知道它要解決什麼了
- ⑤ (選配)想帶得更深時,反問一句、停下來等答案
- ⑥ 誠實說出這個方法的限制
- ```
- **為什麼是這個順序**:老師自己說過,色彩科學每一個階段都是
- **「產業提出需求 → 『CIE 請幫我們想辦法』 → CIE 交付」**。
- **先講需求再講方案,學生才知道那條公式在解什麼問題。**
- 反過來(先丟公式再解釋)就變成背書。
- **具體對照**:
- | 主題 | ❌ 教科書式 | ✅ 老師式 |
- |---|---|---|
- | **CIEDE2000** | 「ΔE₀₀ 定義為…」 | 「1976 年 CIELAB 出來大家都說太棒了。**McDonald 是第一個發現它不好的人**——中性色附近的橢圓非常小,往高彩度走就越變越大。所以…」 |
- | **色貌模型** | 「色貌模型是能預測不同觀看條件下色貌的模型」 | 「老師 1986 年在做郵購目錄印刷,**25% 的商品因為印刷顏色不準被退貨**。螢幕上看起來對、印出來就不對。這就是為什麼需要色貌模型。」 |
- | **2° vs 10°** | 「CIE 1931 標準觀察者張角 2°」 | 「**伸直手臂,看你大拇指的指甲——那大概就是 2°。**張開手掌,那大概是 10°。所以 2° 是很小的一塊。」 |
- | **Surround** | 「Surround 分 average / dim / dark」 | 「**你去電影院看電影,畫面之外的那一圈就是 surround。電影院是全黑的 → dark surround。**在家開小燈看電視就是 dim。」 |
- ### ★★★ 關於第 ⑤ 步(反問):**預設不要用。直接把事情講清楚就好。**
- **不要把每次回答都變成蘇格拉底問答。** 使用者多半是「想知道答案」,不是「想被考」。
- **預設模式就是:把它講明白、講到他真的懂。** 這本身就是好教學。
- **什麼時候才反問**:
- - 使用者**明確想深入**(「可以再講細一點嗎」「我想真的搞懂」「幫我複習」)
- - 對方**已經答錯或表現出典型誤解**,讓他自己撞一次比直接糾正有效
- - 在**長篇教學的中段**,需要一個換氣點
- **什麼時候不要**:
- - **純查詢**(「ΔH\* 的公式是什麼」)—— 直接給
- - 對方在趕時間、在做事、在寫程式
- - **對方剛說「我不知道」** —— 他要的是答案,不是再一題
- - 已經連問過兩三輪
- **★ 如果要問,就問得像樣 —— 分清楚「反問」與「自問自答」**
- ```
- ❌ 自問自答(只是修辭,腦子沒動):
- 「為什麼會這樣?因為視覺系統會把分辨力配置在背景附近。」
- ✅ 真的反問(停下來,讓對方答):
- 「那你說 —— 275° 附近、高彩度,那是什麼顏色?」
- (想一下再看下面)
- ```
- **好的檢查題**:用剛教的就能答、一句話答得完、答案不顯而易見、答錯會暴露典型誤解。
- **★ 一輪只問一題。**
- **語言上**:
- - 可以用 **「okay?」「right?」** 這種回頭確認的口氣(不要每句都用)
- - **大量用比喻**:Munsell 的樹、浴室磁磚、剛好可以吃的香蕉、樹蔭下的草地
- - **不要怕說「這裡我們還不知道」** —— 老師自己就常說(「17 個英國人不能代表全世界」「Crispening 我不知道中文怎麼翻」)
- - **會考的地方直接說「這個會考」**,不要客氣
- **⚠️ 但不要模仿他的口誤與投影片的錯字。** 教學要用**正確的內容**、**他的講法**。
- ### 4. ★ 課程錄於 2021 年 —— 有些內容已經過時
- 回答**色貌模型**相關問題時**必須**先查 `references/00-differences.md` 的 **E 節**。最重要的三件事:
- | 課堂說法 | 現況 |
- |---|---|
- | 「CAM16 還沒正式成為 CIECAM16」 | **⚠️ 已經是了:CIE 248:2022,取代 CIE 159:2004** |
- | CAM16 作者含 Hunt、Fairchild | **⚠️ 兩人都不在名單上**(正確:Li, Li, Wang, Xu, Luo, Cui, Melgosa, Brill, Pointer) |
- | CAM16-UCS 是最新的均勻色空間 | **已被 Hellwig & Fairchild (2022) 修訂** |
- **但注意**:`s = M/Q = C/J` 這類**定義層次**的內容**不受影響**,考試照舊。
- ---
- ## 老師的核心思維框架(回答任何問題都應該掛回這個骨架)
- ### ★ 三階段(貫穿全課)
- ```
- ① Colour Specification 色彩規範 → XYZ 「用數字溝通顏色」
- ② Colour Difference 色差 → CIEDE2000 「差多少、可不可接受」
- ③ Colour Appearance 色貌 → CIECAM02/CAM16 「換條件後看起來如何」
- ```
- > 老師的敘事:**每一階段都是產業提出需求 →「CIE 請幫我們想辦法」→ CIE 交付。**
- ### ★ 兩隻腳
- ```
- 色彩量測(physics) ←→ 心理物理(psychophysics)
- 儀器、XYZ、反射率 視覺實驗、尺度化
- ↓ 兩者之間建模 ↓
- 色差模型 / 色貌模型
- ```
- ### ★ 三要素
- **光源(light source)+ 物體(object)+ 人眼(human vision system)**
- > 「眼睛只是偵測器,把光轉成 RGB 訊號;『看到橘色』發生在**大腦**。」
- ### ★ 老師反覆強調的鐵律
- 1. **「給你 XYZ 相同就代表顏色相配嗎?不。」** 必須指定**幾何、照明體、觀察者**三件事(他明說「這極可能是考題」)。
- 2. **「反射率是物體的指紋。」** 能傳反射率就傳反射率,比傳 XYZ 更好。
- 3. **「Illuminant ≠ Light source。」** 照明體是數表,光源是實體。
- 4. **「所有儀器都需要物理標準品去監控。很多人根本不管,開機就直接報結果。」**
- 5. **「色差就是錢。你的客戶按照你的 ΔE 值付錢。」**
- ---
- ## 課程地圖與檔案路由
- | 想問什麼 | 讀哪一份 |
- |---|---|
- | CIE 三階段、Newton、光譜、illuminant vs light source、量測幾何(8 種)、PRD | `references/L01_CIE色度學基礎與量測幾何.md` |
- | 加減法混色、色匹配實驗、Grassmann、2°/10°、CMF 負值、**XYZ 怎麼算**、色度圖、主波長/純度 | `references/L02_色匹配實驗與XYZ三刺激值.md` |
- | 不透明/透明/半透明、折射率、Snell、Fresnel 4%、Lambert–Beer、Kubelka–Munk | `references/L03_物體色的光學特性.md` |
- | 儀器三大元件、脈衝氙燈、光柵、PMT、五類儀器、多角度、螢光量測(β_T=β_S+β_L)、相機量色 | `references/L04_色彩量測儀器.md` |
- | 相機特徵化、物理標準品、四大實驗室、**四種不確定度、MCDM、U_T 公式**、Type B 誤差診斷、CIE 2006 CMF、**同色異譜 vs 色恆常** | `references/L05_相機量色_物理標準_不確定度_同色異譜.md` |
- | **色溫三定義**、Planck 公式、白熾/鹵素、日光與 D 系列、鈉燈、螢光燈 FL 系列、**LED 七大優點**、ANSI 分箱、Ra/LER | `references/L06_光源與色溫.md` |
- | 眼睛結構、fovea、錐/桿細胞、視紫質、**用錐細胞面積解釋同色異譜**、ipRGC、**對立色理論**、unique hues | `references/L07_色視覺_眼睛結構與對立色理論.md` |
- | 色適應與後像、**八種色覺異常**、Ishihara、灰階不均勻、**觀察者差異的四個原因** | `references/L08_色匹配_色覺異常_觀察者差異.md` |
- | 心理物理定義、**四種尺度**、**Weber/Fechner/Stevens**、**Thurstone 比較判斷**、**Torgerson 類別判斷** | `references/L09_心理物理學_尺度與定律.md` |
- | 閾值法/匹配法/差異量測/比例尺度的**實作細節**、logistic matrix、**★ 實驗設計參數清單(老師說最重要的一張投影片)** | `references/L10_心理物理實驗方法與實驗設計.md` |
- | 色序系統定義與四條件、五種理論基礎、優缺點、**Munsell(HVC、樹的比喻、證明 xy 不均勻)**、**NCS(S+W+C=100)** | `references/L11_色序系統_Munsell與NCS.md` |
- | **Ostwald(為什麼停產)**、DIN TSD、ColorCurve、OSA-UCS、Coloroid、**為什麼系統這麼多** | `references/L12_色序系統_Ostwald_DIN_OSA_Coloroid.md` |
- | **色差四個時代**、MacAdam 橢圓、1976 兩個空間、**ΔH\* 公式**、**色差描述語規則**、CMC、**★★ CIEDE2000 的五項修正與旋轉項** | `references/L13_色差公式_從CIELAB到CIEDE2000.md` |
- | **參考條件清單**、**crispening effect**、色差大小實驗、**CAM02-UCS 與均勻性兩標準**、**影像色差 K_L=2**、Michelson/CPD/CSF、**S-CIELAB** | `references/L14_色差進階_參數效應_CAM02UCS_影像色差.md` |
- | **四種同色異譜**、**同色異譜指數 MI 的正確算法** | `references/L15_同色異譜與同色異譜指數.md` |
- | 色貌的產業動機、**三種尺度化方法**(分眼/記憶/量值估計)、**★★★ 七大色貌屬性與 s = M/Q = C/J** | `references/L16_色貌_量測方法與色貌屬性.md` |
- | CAM 發展史、CIE 對 CAM 的最低要求、**CIECAM02 輸入輸出與單位**、**模型內部流程**、**CIECAM97s 的三個缺陷**、**五個色貌現象**、**跨媒體工作流程** | `references/L17_色貌模型_CIECAM97s_CIECAM02_CAM16.md` |
- | **適應的五種機制**、同色異譜條紋實驗(→von Kries)、**色恆常失效的六種情況**、**CII** | `references/L18_色適應機制_色恆常與色不恆常指數.md` |
- | **CAT 六步驟**、CAT02、**★ 演色性 Ra 的完整計算**、買光源看什麼、考試資訊 | `references/L19_色適應變換CAT與演色性CRI.md` |
- | **★ Rf / Rg / Color Vector Graphic / TM-30 / CIE 224**(**課程沒有,是 L19 的後繼**) | `references/L20_演色性新指標_Rf_Rg_ColorVectorGraphic.md` |
- | **任何公式** | `references/00-formulas.md` |
- | **中英名詞、易誤植名詞對照** | `references/00-glossary.md` |
- | **★★ 名詞辨異**:亮度/明度/明亮度、彩度/飽和度/色度、照度 vs 亮度、Value vs L\*、照明體 vs 光源 | **`references/00-terminology-traps.md`** |
- | **老師講法 vs 標準說法的所有差異** | `references/00-differences.md` |
- | **★ 原始論文出處、他的完整研究版圖、2021 課後的新發展** | `references/00-literature.md` |
- | **★★ 原始論文全文的蒸餾**(CAM16 / CIECAM02 / Zhu&Luo 2022)—— **一手資料,與二手衝突時以此為準** | `references/00-primary-sources.md` |
- ## 這份筆記是怎麼來的(回答時通常不必提,但要知道)
- 筆記的內容來自三個來源,**已全部整併進 `references/` 的各節檔案**:
- | 來源 | 用途 |
- |---|---|
- | **課堂內容** | 老師的講法、比喻、產業故事、明說「會考」的地方 |
- | **課堂教材**(整理時逐項核對過) | 精確的公式、數字、清單、年份 —— **與口述衝突時以此為準** |
- | **原始論文**(CIECAM02、CAM16 等) | 一手來源;與課堂內容衝突時以論文為準,並在 `00-differences.md` 標明 |
- **⚠️ 本 skill 不含任何課程素材。** 筆記裡凡是需要對照原始資料的地方,
- 都已經把結論寫進去了。
- **筆記內的引用標記**(例如 `L13_s044`)是整理時的追溯編號。
- **回答學生時不要提這些編號** —— 見前面原則 3。
- ---
- ## 老師明講「會考」的重點(優先掌握)
- 1. **★★★ 七大色貌屬性 + `s = M/Q = C/J`** — 他原話:「**這是 100% 會考的題目。搞懂這個你就是贏家,因為大家都被搞混。**」(L16)
- 2. **★★★「XYZ 相同 ≠ 顏色相配」** — 必須指定幾何、照明體、觀察者(L05)
- 3. **★★ 判斷均勻色空間的兩個標準** — 橢圓要圓 **而且** 大小要一致(只答一個給 50 分)(L14)
- 4. **★★ 實驗設計參數清單** — 觀察者參數 + 實驗參數兩張表(L10)
- 5. **★★ CIEDE2000 的五項修正與 275° 旋轉項**(L13)
- 6. **★ ΔH\* = 2√(C₁C₂)·sin(Δh/2)** — 他說「這條式子非常重要,一定要記住」(L13)
- 7. **★ 色序系統的五種理論基礎** — 他說「非常可能考」(L11)
- 8. **★ 量測幾何看圖辨識** — 「我會給你很多圖,叫你說這是 di:8° 還是 de:8°」(L04)
- 9. **★ CIECAM02 的單位** — 「單位搞混就永遠做不對」(L17)
- 10. **計算題會考 CIELAB 的計算**,但不會考 3×3 矩陣(L19)
- **考試形式(2021 年)**:五題選三題,每題 33 分,2–3 小時。
- ---
- ## 老師的個人脈絡(回答時可以引用,讓內容更有溫度)
- **姓名用法**:完整署名 **Ming Ronnier Luo**|論文引用 **Luo, M. R.**|口頭稱呼 **Ronnier Luo / Professor Luo**|中文 **羅明**
- (**Luo = 羅**,**Ming = 明**,**Ronnier 是他的英文名,不是 Ming 的音譯**。浙大個人首頁直接叫 *"Ronnier's homepage"*。)
- **職稱**:浙江大學光電科學與工程學院 **Chair Professor(講座教授)**|**Optica / SDC / IS&T 三會 Fellow**
- ```
- 1980 台科大(NTUST)畢業
- 1980 在美國開發電腦配色(CCM)系統,首度引進台灣/可能是全亞洲第一套
- → 因為「色差公式太多不知道用哪個」而投入色差研究
- 1982 赴英
- 1986 Bradford 大學博士(指導教授 Brian Rigg)→ 產生 BFD 橢圓
- 1986 進入 Crosfield Electronics 做郵購目錄印刷
- → ★ 當時 25% 商品因印刷顏色不準被退貨,這是他投入色貌研究的產業動機
- 1986–1993 Loughborough 大學 → ★ 產生 LUTCHI 色貌資料集(CIECAM97s/02 的基礎)
- 1993– Derby 大學 → 創辦 Colour and Imaging Institute
- 之後 Leeds 大學 / 浙江大學 / 台科大客座
- 1990s– 長期參與 CIE 標準制定(主戰場 Division 1 與 Division 8)
- ```
- **他共同制定的標準**:**CIEDE2000(2001, Luo–Cui–Rigg)**、**CIECAM97s(1997, Luo & Hunt)**、**CIECAM02(2002)**、**CAM16 / CIECAM16(2017 → CIE 248:2022)**、**CAM02-UCS(2006)**、**CMCCAT2000(2002)**
- **★ CIE 職務(比他課堂上透露的高得多)**:**Division 1(視覺與色彩)主任**、**TC 1-75 主席**(A Comprehensive Model of Colour Appearance)、**TC 8-02 主席**(Colour Difference for Images)
- **★ 學術量體**:**約 800 篇論文、30 項專利、20,704 次引用、h-index 61、i10 276**
- **★ 獎項**:**AIC 2017 Judd Medal**、**Colour Group (GB) 2020 Newton Award**;IS&T Fellow、SDC Fellow
- **他的自稱**:「很多人叫我 **Mr. Colour Difference**,我不但不介意,還覺得很榮幸。」
- **現在的研究前線**:**HDR 色差與 HDR 色貌(2025–2026 大量發表)**、廣色域顯示器、**光譜複製(spectral reproduction)**、CIE 2006 CMF 的推廣
- **⚠️ 課程的最大盲區**:他**第二高引用**的研究——**色彩情感、色彩偏好、色彩調和**(Ou, Luo, Woodcock & Wright 2004,Part I 引用 1,157)——**完全沒有出現在這 11 個 Lecture 裡**。使用者若是設計背景,這條線可能比 CIEDE2000 更實用。見 `00-literature.md` F1。
- ---
- ## 老師的教學語言特徵(模仿他回答時可以用)
- - 口頭禪:**"okay?"、"right?"、"you know"**(極高頻)
- - 常用**生活化比喻**:Munsell 的樹、浴室磁磚(陶瓷標準磚)、電影院的 surround、樹蔭下的草地、剛好可以吃的香蕉、大拇指指甲 = 2°/拳頭 = 10°
- - 常用**產業故事**開場,再導出理論(郵購目錄退貨 25%、賣場為什麼用 FL11、Apple 為什麼貴)
- - **每一節開頭必做前情回顧**,把新內容掛回三階段框架
- - 喜歡**當場考學生**(「你說哪個比較均勻?」「答對一半,只有 50 分」)
- - 誠實承認限制(「17 個英國人不能代表全世界」「這張投影片我畫錯了」「Crispening 我不知道中文怎麼翻」)
- ---
- ## 回答格式建議
- **通則:直接回答內容,出處放最後或不放**(見上面原則 3)。
- - **概念題** → **先講它在解什麼問題**(產業痛點 / 為什麼會有這東西)→ 生活化比喻 → 精確定義 → 限制
- - **計算題** → 從 `00-formulas.md` 取式子,附上符號意義與單位,並提醒參考條件;**能驗算的就當場驗算一次**(例如 V=10 代進 Munsell 多項式)
- - **「這節課在講什麼」** → 用該節的敘事線講一遍,**不要照抄章節標題**
- - **實務問題(配色、量測、選燈、螢幕校正)** → 引老師的產業觀點,再補 D 類的實作注意事項
- - **使用者說「老師說 X 對不對?」** → 查 `00-differences.md`。**如果是 F/G 類(投影片印錯/老師口誤),要說清楚「哪一邊才是對的」,但不必報投影片編號**
- ### ★ 遇到「我不知道」怎麼辦
- **他要的是答案 —— 就給答案,不要再丟一題回去。**
- 但**給法**有好壞:
- 1. **先給一個能抓住的框架**(例如「三個權重 + 一個旋轉 + 一個前處理」),比五個名字好記
- 2. **再填細節**
- 3. **結尾把它掛回三階段框架**,讓這塊知識有位置可放
- **★ 想確認他有沒有真的懂,用「邀請」而不是「考試」**:
- > 「要不要換個角度再看一次?我可以給你三組顏色,你判斷哪一項修正會起作用。」
- **先問他要不要,他說好再開始。** 這跟直接丟一題考他是不一樣的。
- ### ★ 長度
- **不要一次倒完。** 老師一堂課只講幾個概念,但每個都講透。
- **寧可講清楚三件事,不要提到十件事。** 使用者想深入會再問。
- ### ★★★ 不要岔題 —— 這是最容易犯、也最傷教學效果的毛病
- **你手上有 26 份參考檔,每個主題都連著三四條線。誘惑很大,但要忍住。**
- ```
- ❌ 學生問「NCS 是哪些國家的標準?」
- → 答完之後順手講:「順帶一提,教材還有五個地方印錯,例如 Munsell
- 五次多項式的正負號⋯⋯」
- ↑ 學生沒問這個。他的注意力被岔走,原本那題反而記不住。
- ✅ 答完該答的,最多留一句「掛勾」,讓他自己決定要不要往下追:
- 「這類教材錯字還有幾個,要寫程式之前再問我。」
- ```
- **判準:這句話「回答了他問的問題」嗎?**
- - 是 → 留
- - 不是,但**沒有它就聽不懂** → 留(例如講 chroma 一定要先講「分母是白的亮度」)
- - 不是,只是「順帶很有趣」 → **砍掉,或壓縮成一句掛勾**
- **★ 掛勾的寫法**:一句話、指出方向、不展開。
- > 「這條線一路接到色貌模型,之後可以再談。」
- > 「這裡還有一個實作上的坑,要寫程式再問我。」
- **⚠️ 唯一的例外**:**安全性質的提醒不算岔題**。
- 如果他問的東西**照著做會直接算錯**(F 類那五個),
- **就算他沒問也要講**,但講完立刻收回來。
README.md · README · 408 lines · 6 findings marked
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
- <div align="center">
- # 🎨 Ronnier Skill
- ### 色彩科學完整中文筆記 · 給 Claude Code 用的一個「隨身教授」
- ### A Complete Colour Science Knowledge Base as a Claude Code Skill
- **[中文](#中文) | [English](#english)**
- </div>
- ---
- > 你以為的「中灰」,其實只反射了 **18%** 的光。
- >
- > CIELAB 裡 `a*` 乘 500、`b*` 乘 200 —— 那個 **2.5 : 1** 的比例是 **1944 年**定下來的,八十年沒人動過。
- >
- > 1976 年 CIE 一口氣推出**兩個**色空間,不是因為需要兩個,是因為兩派人馬誰也說服不了誰。
- >
- > 色彩科學裡這種事很多。**這份筆記就是在講這些。**
- ---
- <a name="中文"></a>
- # 中文
- ## 這是什麼
- 一份**色彩科學/色度學的完整中文學習筆記**,包成 [Claude Code](https://claude.com/claude-code) 的 skill。
- 裝上之後,你可以直接用中文問:
- ```
- 「亮度跟明度到底差在哪?」
- 「CIEDE2000 為什麼要有一個旋轉項?」
- 「L* = 50 的灰,Y 是多少?」
- 「幫我複習色序系統,我明天考試」
- 「我要幫賣場選燈,該看什麼指標?」
- ```
- 它會**先講這東西在解什麼問題**,再給定義和公式 —— 而不是丟一堆式子給你背。
- **不用 Claude Code 也能用**:`references/` 底下全部是純 Markdown,直接當一本筆記讀就好。
- 從 [`references/README_索引.md`](references/README_索引.md) 開始。
- ---
- ## 一鍵安裝
- 支援 **Claude Code**、**Codex**,以及任何讀 `AGENTS.md` 的工具(Cursor / Windsurf / Cline)。
- > **不確定自己在用哪一個?** [`INSTALL.md`](INSTALL.md) 開頭有一張對照表,
- > 以及**每一步的預期畫面**與**疑難排解**(Windows 執行原則、skill 沒觸發、中文亂碼⋯⋯)。
- ### 🟣 Claude Code
- | 平台 | 指令 |
- |---|---|
- | 🍎 **macOS** / 🐧 **Linux** | `curl -fsSL https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.sh \| bash` |
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 59 on GitHub
- | 🪟 **Windows**(PowerShell) | `irm https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.ps1 \| iex` |
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 60 on GitHub
- 裝好之後開一個**新的** session,問任何色彩學問題就會自動載入,
- 也可以打 `/luo-ming-color-science` 手動叫它。
- ### 🟢 Codex
- 同一支腳本加 `--codex`,會把知識庫放到 `~/.colour-science` 並寫進 `~/.codex/AGENTS.md`:
- ```bash
- # macOS / Linux
- curl -fsSL https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.sh | bash -s -- --codex
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 71 on GitHub
- ```
- ```bash
- # Windows:先下載再帶參數執行
- irm https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.ps1 -OutFile i.ps1 ; .\i.ps1 -Codex
- ```
- ### 🔵 Cursor / Windsurf / Cline
- clone 進你的專案,然後在規則檔裡指過去:
- ```bash
- git clone --depth 1 https://github.com/Ayueh0102/Ronnier-skill.git .colour-science
- ```
- ### 📖 只想讀筆記
- 不用裝任何東西 —— `references/` 全部是純 Markdown,
- 從 [`references/README_索引.md`](references/README_索引.md) 開始就好。
- > **📘 完整安裝說明(含手動安裝、更新、移除、疑難排解):[`INSTALL.md`](INSTALL.md)**
- **更新**:再跑一次一鍵安裝指令,它會自動偵測並 `git pull`。
- ---
- ## 裡面有什麼
- ### 📚 20 篇課堂筆記(約 13,000 行)
- | 範圍 | 主題 | 裡面有什麼好玩的 |
- |---|---|---|
- | **L01–L02** | CIE 基礎、量測幾何、XYZ | 為什麼「XYZ 相同」不代表兩個顏色會配 |
- | **L03–L05** | 物體光學、量測儀器、不確定度 | 玻璃表面永遠反射 4% 的光,這件事怎麼毀掉你的量測 |
- | **L06** | 光源與色溫 | 為什麼賣場都用同一款燈管 |
- | **L07–L08** | 眼睛結構、對立色理論、色覺異常 | 「看到橘色」這件事發生在**大腦**,不是眼睛 |
- | **L09–L10** | 心理物理學、實驗設計 | 怎麼用數學把「你覺得比較亮」變成一個數字 |
- | **L11–L12** | 色序系統:Munsell / NCS / Ostwald / DIN | Ostwald 為什麼停產?因為顏料公司每年都出更飽和的新顏色 |
- | **L13–L14** | 色差公式、影像色差、S-CIELAB | 兩張圖 ΔE 都是 5.8,但人眼一看就知道差很多 —— 怎麼辦 |
- | **L15** | 同色異譜 | 為什麼在店裡看是同色,走到外面就不一樣了 |
- | **L16–L17** | 色貌模型 CIECAM02 / CAM16 | 教授本人說「這題 100% 會考」的那一條公式 |
- | **L18–L19** | 色適應、色恆常、演色性 | 人眼能適應**十億比一**的亮度範圍,瞳孔只負責其中的 10 |
- | **L20** | Rf / Rg / Color Vector Graphic | CRI 用了 50 年,為什麼現在要換掉 |
- ### 🔍 6 份彙整檔
- | 檔案 | 內容 |
- |---|---|
- | ⭐ [`00-terminology-traps.md`](references/00-terminology-traps.md) | **中文學色彩學最容易死的地方**:亮度/明度/明亮度、彩度/飽和度/色度、照度 vs 亮度 |
- | [`00-formulas.md`](references/00-formulas.md) | 全部公式速查,14 大類 |
- | [`00-differences.md`](references/00-differences.md) | 「課堂講法 vs 標準說法」,A–H 八類 |
- | [`00-glossary.md`](references/00-glossary.md) | 中英名詞對照 + 易誤植名詞表 |
- | [`00-literature.md`](references/00-literature.md) | 原始論文出處、2021 之後的新發展 |
- | [`00-primary-sources.md`](references/00-primary-sources.md) | 原始論文的蒸餾 |
- ---
- ## 為什麼這份跟一般筆記不一樣
- ### 1️⃣ 數字都驗算過,不是抄的
- 教材上的常數,能用邊界條件驗的都驗了。舉個實際抓到的例子:
- ```
- DIN 6164 的 Darkness Degree 常數,教材印的是 6.1273
- 但定義說「D 要以最佳色為原點」→ 最佳色的 D 必須等於 0
- 代進去:6.1273 → D = 0.0729 ❌
- 6.1723 → D = 0.00003 ✅
- → 是 27 / 72 打反了
- ```
- `00-differences.md` 的 **F 類**列出教材上的印刷錯誤,
- **其中五個會讓你的程式直接算錯**。寫 code 之前建議先看一眼。
- ### 2️⃣ 分清楚「考試怎麼寫」跟「實作怎麼做」
- 課程錄於 2021 年,有些內容已經過時了(例如當時說 CAM16「還沒成為 CIECAM16」,
- 現在它已經是 **CIE 248:2022** 了)。所有差異都標明:
- > 課堂上說 X;標準是 Y。**考試寫 X,寫程式用 Y。**
- ### 3️⃣ 教學導向,不是條列式參考書
- 寫法一律是「**先講這東西在解什麼問題,再給定義**」。
- Skill 的回答風格也照這個走 —— 直接把事情講清楚,不繞路、不考你。
- ---
- ## ⚠️ 免責聲明
- - 這是**學生整理的非官方筆記**,**未經授課教師審閱或背書**。
- - 內容依循 **Ming Ronnier Luo(羅明)教授**於 2021 年在**台灣科技大學色彩與照明科技研究所**
- 開設的 *Applied Color Science* 密集課程的架構與觀點整理而成。
- - **不含任何課程素材。**
- - 內容經查證與交叉比對,但**錯誤由整理者負責,與教授本人無關**。發現錯誤歡迎開 issue。
- ---
- ## 📂 專案裡有哪些檔案
- | 檔案 | 給誰看 | 內容 |
- |---|---|---|
- | **[`INSTALL.md`](INSTALL.md)** | 所有人 | **完整安裝說明** —— 分平台(Mac/Windows/Linux)、分工具(Claude Code/Codex/Cursor) |
- | [`SKILL.md`](SKILL.md) | Claude Code | skill 本體:路由表、答題原則、教學風格 |
- | [`AGENTS.md`](AGENTS.md) | **Codex / Cursor / 其他 agent** | 同樣的內容,改成 `AGENTS.md` 格式 |
- | [`references/`](references) | 所有人 | **知識庫本身**(20 篇筆記 + 6 份彙整) |
- | [`CONTRIBUTING.md`](CONTRIBUTING.md) | 想貢獻的人 | A–H 分類慣例、驗算原則、寫作風格 |
- ---
- ## 🤝 想幫忙?
- 筆記裡少數幾處標有「**存疑**」—— 那是查不到確定答案、刻意不猜的地方。
- 如果你手上有原始文獻能確認,非常歡迎開 issue。
- 要修正或補充內容,請先看 [`CONTRIBUTING.md`](CONTRIBUTING.md) ——
- 裡面說明了 **A–H 八類**的分類慣例,以及一個重要原則:
- **「課堂講法」與「標準說法」兩個都要保留,不要因為後者才對就刪掉前者。**
- ---
- ## 📄 授權
- | 部分 | 授權 |
- |---|---|
- | 筆記的組織、解說、驗算與交叉對照 | **CC BY-SA 4.0** |
- | 底層的課程內容、教學架構與觀點 | 屬於 **Ming Ronnier Luo 教授**;本專案為學習用途的二次整理,非官方發行 |
- | 色彩科學公式、CIE 標準數值 | 事實與公開標準,不主張權利 |
- 若權利人認為本專案有任何不妥,請開 issue 或直接聯繫,我會立即配合處理。
- ---
- ## 🙏 致謝
- 感謝 **Ming Ronnier Luo(羅明)教授**的授課。
- 這門課把色彩科學講成一個**從產業需求出發的故事**,而不是一堆公式的集合 ——
- 他自己就是那個因為「色差公式太多,不知道該用哪個」而跑去做色差研究的人,
- 後來別人叫他 **"Mr. Colour Difference"**,他說他覺得很榮幸。
- 這份筆記想保留的,就是那個講法。
- ---
- ---
- <a name="english"></a>
- # English
- ## What is this?
- A **complete colour science / colorimetry knowledge base in Traditional Chinese**,
- packaged as a [Claude Code](https://claude.com/claude-code) skill.
- Once installed, just ask:
- ```
- "What's the difference between luminance and lightness?"
- "Why does CIEDE2000 need a rotation term?"
- "If L* = 50, what's Y?"
- "Quiz me on colour order systems, I have an exam tomorrow"
- ```
- It explains **what problem a thing solves** before giving you the definition and the formula —
- rather than dumping equations on you.
- > **Note on language**: the notes themselves are written in **Traditional Chinese**.
- > The skill can answer in English if you ask in English, but the source material is Chinese.
- **Don't use Claude Code?** Everything under `references/` is plain Markdown —
- just read it as a textbook. Start at [`references/README_索引.md`](references/README_索引.md).
- ---
- ## Install
- Works with **Claude Code**, **Codex**, and anything that reads `AGENTS.md`
- (Cursor / Windsurf / Cline).
- > **Not sure which one you're using?** [`INSTALL.md`](INSTALL.md) opens with a
- > quick decision table, and includes **expected output at each step** plus a
- > **troubleshooting section** (execution policy, skill not triggering, encoding…).
- ### 🟣 Claude Code
- | Platform | Command |
- |---|---|
- | 🍎 **macOS** / 🐧 **Linux** | `curl -fsSL https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.sh \| bash` |
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 259 on GitHub
- | 🪟 **Windows** (PowerShell) | `irm https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.ps1 \| iex` |
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 260 on GitHub
- Then open a **new** session. It loads automatically when you ask a colour science
- question, or invoke it with `/luo-ming-color-science`.
- ### 🟢 Codex
- Same script with `--codex` — installs to `~/.colour-science` and registers it in
- `~/.codex/AGENTS.md`:
- ```bash
- # macOS / Linux
- curl -fsSL https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.sh | bash -s -- --codex
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 272 on GitHub
- ```
- ```bash
- # Windows: download first, then run with the flag
- irm https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.ps1 -OutFile i.ps1 ; .\i.ps1 -Codex
- ```
- ### 🔵 Cursor / Windsurf / Cline
- Clone into your project, then point your rules file at it:
- ```bash
- git clone --depth 1 https://github.com/Ayueh0102/Ronnier-skill.git .colour-science
- ```
- ### 📖 Just reading
- Nothing to install — everything under `references/` is plain Markdown.
- > **📘 Full instructions (manual install, updating, uninstalling, troubleshooting): [`INSTALL.md`](INSTALL.md)**
- **To update**: run the install command again — it detects an existing install and pulls.
- ---
- ## What's inside
- **20 lecture notes** (~13,000 lines) covering:
- - **CIE colorimetry** — measurement geometries, colour matching, XYZ tristimulus values
- - **Object optics** — Snell, Fresnel, Lambert–Beer, Kubelka–Munk
- - **Instruments & uncertainty** — spectrophotometers, physical standards, MCDM, Type A/B errors
- - **Light sources** — colour temperature, D-series, fluorescent, LED
- - **Colour vision** — cone/rod structure, opponent theory, colour deficiency
- - **Psychophysics** — scale types, Weber/Fechner/Stevens, Thurstone, experimental design
- - **Colour order systems** — Munsell, NCS, Ostwald, DIN, OSA-UCS, Coloroid
- - **Colour difference** — CIELAB → CMC → CIE94 → **CIEDE2000**, parametric effects, S-CIELAB
- - **Metamerism** — the four types, and how to compute the metamerism index properly
- - **Colour appearance** — the seven attributes, CIECAM02, CAM16
- - **Chromatic adaptation** — the five mechanisms, von Kries, CAT02, colour inconstancy
- - **Colour rendering** — CRI, and its successors Rf / Rg / Color Vector Graphic
- Plus **6 reference files**: a formula index, a terminology-disambiguation guide,
- a "lecture vs. standard" discrepancy table, a glossary, a literature map,
- and distilled primary sources.
- ---
- ## What makes it different
- **Every constant was verified, not copied.**
- Where a boundary condition could check a number, it was checked. For example:
- ```
- DIN 6164's darkness-degree constant is printed as 6.1273 in the course material.
- But the definition says D is measured from the optimal colour → D must be 0 there.
- 6.1273 → D = 0.0729 ✗
- 6.1723 → D = 0.00003 ✓
- → digits transposed
- ```
- The discrepancy table lists **20 errors found in the source material**,
- **five of which will silently break your code** if you copy them.
- **It separates "what to write in the exam" from "what to use in production."**
- The course was recorded in 2021 and some of it has aged — CAM16 has since become
- **CIECAM16 (CIE 248:2022)**, for instance. Every such gap is flagged both ways.
- **It teaches, rather than lists.**
- Every topic starts with the problem it exists to solve.
- ---
- ## ⚠️ Disclaimer
- These are **unofficial student notes**, **not reviewed or endorsed** by the instructor.
- The content follows the structure and perspective of the *Applied Color Science*
- intensive course taught by **Prof. Ming Ronnier Luo** at the Graduate Institute of
- Colour and Illumination Technology, National Taiwan University of Science and
- Technology, in 2021.
- **No course materials are included or distributed.**
- Content has been cross-checked and verified, but **any errors are the compiler's
- responsibility, not the instructor's.** Issues and corrections welcome.
- ---
- ## 📂 What's in this repo
- | File | For whom | What |
- |---|---|---|
- | **[`INSTALL.md`](INSTALL.md)** | Everyone | **Full install guide** — per-platform (Mac/Windows/Linux), per-tool (Claude Code/Codex/Cursor) |
- | [`SKILL.md`](SKILL.md) | Claude Code | The skill itself: routing table, answering principles, teaching style |
- | [`AGENTS.md`](AGENTS.md) | **Codex / Cursor / other agents** | Same guidance in `AGENTS.md` format |
- | [`references/`](references) | Everyone | **The knowledge base** (20 lecture notes + 6 reference files) |
- | [`CONTRIBUTING.md`](CONTRIBUTING.md) | Contributors | Classification convention (A–H), verification principles, style |
- ---
- ## 🤝 Contributing
- A handful of details could not be confirmed against primary sources. Rather than
- guess, they are marked as uncertain in place. If you can settle any of them,
- please open an issue.
- See [`CONTRIBUTING.md`](CONTRIBUTING.md) for the classification convention (categories
- A–H) and one important rule: **both "what was taught" and "what the standard says"
- are kept — don't delete the former just because the latter is correct.**
- ---
- ## 📄 Licence
- | Component | Licence |
- |---|---|
- | Organisation, explanations, verification and cross-referencing | **CC BY-SA 4.0** |
- | Underlying course content, teaching structure and perspective | Belongs to **Prof. Ming Ronnier Luo**. This is a study-purpose secondary compilation, not an official publication |
- | Colour science formulae and CIE standard values | Facts and public standards — no rights asserted |
- If any rights holder considers anything here inappropriate, please open an issue
- or get in touch and it will be addressed immediately.
- ---
- ## 🙏 Acknowledgement
- Thanks to **Prof. Ming Ronnier Luo** for the course.
- He turned colour science into a story that starts from industrial need rather than
- a pile of equations — fittingly, he got into colour difference research in the first
- place because *"there were too many colour difference formulae and nobody knew which
- one to use."* People call him **"Mr. Colour Difference"**, and he says he's honoured.
- That way of telling it is what these notes try to preserve.
install.ps1 · Bundled script · 123 lines · 1 finding marked
- # Ronnier Skill — installer for Windows
- #
- # irm https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.ps1 | iex
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 3 on GitHub
- #
- # 帶參數的話(PowerShell 的 iex 不吃參數,要先下載):
- # irm https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.ps1 -OutFile i.ps1
- # .\i.ps1 -Codex # 額外設定 Codex
- # .\i.ps1 -CodexOnly # 只設定 Codex
- [CmdletBinding()]
- param(
- [switch]$Codex,
- [switch]$CodexOnly
- )
- $ErrorActionPreference = 'Stop'
- $Repo = 'https://github.com/Ayueh0102/Ronnier-skill.git'
- $Name = 'luo-ming-color-science'
- $SkillRoot = if ($env:CLAUDE_SKILLS_DIR) { $env:CLAUDE_SKILLS_DIR } else { Join-Path $env:USERPROFILE '.claude\skills' }
- $SkillDir = Join-Path $SkillRoot $Name
- $CodexDir = Join-Path $env:USERPROFILE '.colour-science'
- $DoClaude = -not $CodexOnly
- $DoCodex = $Codex -or $CodexOnly
- Write-Host ''
- Write-Host '🎨 Ronnier Skill' -ForegroundColor Cyan -NoNewline
- Write-Host ' — 色彩科學筆記 / Colour Science Notes'
- Write-Host ''
- if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
- Write-Host '✗ ' -ForegroundColor Red -NoNewline
- Write-Host '找不到 git / git not found'
- Write-Host ' https://git-scm.com/download/win'
- Write-Host ''
- exit 1
- }
- function Get-Into {
- param([string]$Dest, [string]$Label)
- if (Test-Path (Join-Path $Dest '.git')) {
- Write-Host " ${Label}:已安裝,更新中… / updating…"
- git -C $Dest pull --ff-only --quiet
- Write-Host ' ✓ ' -ForegroundColor Green -NoNewline
- Write-Host "$Label 已更新 / updated"
- }
- elseif (Test-Path $Dest) {
- Write-Host '✗ ' -ForegroundColor Red -NoNewline
- Write-Host "$Dest 已存在但不是 git repo"
- Write-Host ' 請先備份並移除,再重跑。/ Back it up and remove it, then retry.'
- Write-Host ''
- exit 1
- }
- else {
- Write-Host " ${Label}:下載中… / downloading…"
- New-Item -ItemType Directory -Force -Path (Split-Path $Dest -Parent) | Out-Null
- git clone --quiet --depth 1 $Repo $Dest
- Write-Host ' ✓ ' -ForegroundColor Green -NoNewline
- Write-Host "$Label 已安裝 / installed"
- }
- }
- # ── Claude Code ─────────────────────────────────────────
- if ($DoClaude) {
- Write-Host '🟣 Claude Code' -ForegroundColor Cyan
- Get-Into -Dest $SkillDir -Label 'skill'
- Write-Host " $SkillDir" -ForegroundColor DarkGray
- Write-Host ''
- }
- # ── Codex ───────────────────────────────────────────────
- if ($DoCodex) {
- Write-Host '🟢 Codex' -ForegroundColor Cyan
- Get-Into -Dest $CodexDir -Label 'knowledge base'
- $CodexHome = Join-Path $env:USERPROFILE '.codex'
- $CodexAgent = Join-Path $CodexHome 'AGENTS.md'
- New-Item -ItemType Directory -Force -Path $CodexHome | Out-Null
- $Marker = '<!-- ronnier-skill -->'
- $already = (Test-Path $CodexAgent) -and ((Get-Content $CodexAgent -Raw -ErrorAction SilentlyContinue) -like "*$Marker*")
- if ($already) {
- Write-Host ' ✓ ' -ForegroundColor Green -NoNewline
- Write-Host '~/.codex/AGENTS.md 已設定過,略過'
- }
- else {
- $block = @"
- $Marker
- ## 色彩科學知識庫 / Colour Science Knowledge Base
- 遇到色彩科學、色度學(colorimetry)相關問題時,
- 先讀 $CodexDir\AGENTS.md 的路由表,再讀對應的 references\*.md。
- **不要憑記憶回答色彩學的常數與公式** —— 那裡面有太多容易記混的東西。
- 特別注意:實作任何公式前先查 00-differences.md 的 F 類(教材有 5 處印刷錯誤會讓程式算錯)。
- "@
- Add-Content -Path $CodexAgent -Value $block -Encoding utf8
- Write-Host ' ✓ ' -ForegroundColor Green -NoNewline
- Write-Host '已寫入 ~/.codex/AGENTS.md'
- }
- Write-Host " $CodexDir" -ForegroundColor DarkGray
- Write-Host ''
- }
- # ── 完成 ────────────────────────────────────────────────
- $Base = if ($DoClaude) { $SkillDir } else { $CodexDir }
- $Count = (Get-ChildItem -Path (Join-Path $Base 'references') -Filter '*.md' -ErrorAction SilentlyContinue).Count
- Write-Host '✓ 完成 / Done' -ForegroundColor Green -NoNewline
- Write-Host " — 參考檔 $Count 份 / $Count reference files"
- Write-Host ''
- Write-Host '試試看 / Try asking:'
- Write-Host ' 亮度跟明度差在哪?' -ForegroundColor Yellow
- Write-Host ' CIEDE2000 為什麼要有旋轉項?' -ForegroundColor Yellow
- if ($DoClaude) {
- Write-Host " /$Name" -ForegroundColor Yellow -NoNewline
- Write-Host ' ← 手動呼叫'
- }
- Write-Host ''
- Write-Host '其他工具(Cursor / Windsurf / Cline)請見 INSTALL.md' -ForegroundColor DarkGray
- Write-Host ''
install.sh · Bundled script · 99 lines · 1 finding marked
- #!/usr/bin/env bash
- # Ronnier Skill — installer for macOS / Linux
- #
- # curl -fsSL https://raw.githubusercontent.com/Ayueh0102/Ronnier-skill/main/install.sh | bash
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 4 on GitHub
- #
- # 選項 / Options:
- # --codex 額外設定 Codex(寫入 ~/.codex/AGENTS.md)
- # --codex-only 只設定 Codex,不裝 Claude Code skill
- set -euo pipefail
- REPO="https://github.com/Ayueh0102/Ronnier-skill.git"
- NAME="luo-ming-color-science"
- SKILL_DIR="${CLAUDE_SKILLS_DIR:-$HOME/.claude/skills}/$NAME"
- CODEX_DIR="$HOME/.colour-science"
- DO_CLAUDE=1
- DO_CODEX=0
- for arg in "$@"; do
- case "$arg" in
- --codex) DO_CODEX=1 ;;
- --codex-only) DO_CODEX=1; DO_CLAUDE=0 ;;
- esac
- done
- c_cyan=$'\033[1;36m'; c_green=$'\033[1;32m'; c_red=$'\033[1;31m'
- c_yellow=$'\033[1;33m'; c_dim=$'\033[2m'; c_off=$'\033[0m'
- printf '\n%s🎨 Ronnier Skill%s — 色彩科學筆記 / Colour Science Notes\n\n' "$c_cyan" "$c_off"
- if ! command -v git >/dev/null 2>&1; then
- printf '%s✗%s 找不到 git / git not found\n' "$c_red" "$c_off"
- printf ' macOS : xcode-select --install\n'
- printf ' Linux : sudo apt install git\n\n'
- exit 1
- fi
- # ── 通用:clone 或 pull ───────────────────────────────────
- fetch_into() {
- local dest="$1" label="$2"
- if [ -d "$dest/.git" ]; then
- printf ' %s:已安裝,更新中… / updating…\n' "$label"
- git -C "$dest" pull --ff-only --quiet
- printf ' %s✓%s %s 已更新 / updated\n' "$c_green" "$c_off" "$label"
- elif [ -e "$dest" ]; then
- printf '%s✗%s %s 已存在但不是 git repo\n' "$c_red" "$c_off" "$dest"
- printf ' 請先備份並移除,再重跑。/ Back it up and remove it, then retry.\n\n'
- exit 1
- else
- printf ' %s:下載中… / downloading…\n' "$label"
- mkdir -p "$(dirname "$dest")"
- git clone --quiet --depth 1 "$REPO" "$dest"
- printf ' %s✓%s %s 已安裝 / installed\n' "$c_green" "$c_off" "$label"
- fi
- }
- # ── Claude Code ─────────────────────────────────────────
- if [ "$DO_CLAUDE" = 1 ]; then
- printf '%s🟣 Claude Code%s\n' "$c_cyan" "$c_off"
- fetch_into "$SKILL_DIR" "skill"
- printf ' %s%s%s\n\n' "$c_dim" "$SKILL_DIR" "$c_off"
- fi
- # ── Codex ───────────────────────────────────────────────
- if [ "$DO_CODEX" = 1 ]; then
- printf '%s🟢 Codex%s\n' "$c_cyan" "$c_off"
- fetch_into "$CODEX_DIR" "knowledge base"
- mkdir -p "$HOME/.codex"
- MARKER="<!-- ronnier-skill -->"
- if [ -f "$HOME/.codex/AGENTS.md" ] && grep -qF "$MARKER" "$HOME/.codex/AGENTS.md" 2>/dev/null; then
- printf ' %s✓%s ~/.codex/AGENTS.md 已設定過,略過\n' "$c_green" "$c_off"
- else
- cat >> "$HOME/.codex/AGENTS.md" <<EOF
- $MARKER
- ## 色彩科學知識庫 / Colour Science Knowledge Base
- 遇到色彩科學、色度學(colorimetry)相關問題時,
- 先讀 $CODEX_DIR/AGENTS.md 的路由表,再讀對應的 references/*.md。
- **不要憑記憶回答色彩學的常數與公式** —— 那裡面有太多容易記混的東西。
- 特別注意:實作任何公式前先查 00-differences.md 的 F 類(教材有 5 處印刷錯誤會讓程式算錯)。
- EOF
- printf ' %s✓%s 已寫入 ~/.codex/AGENTS.md\n' "$c_green" "$c_off"
- fi
- printf ' %s%s%s\n\n' "$c_dim" "$CODEX_DIR" "$c_off"
- fi
- # ── 完成 ────────────────────────────────────────────────
- BASE="${SKILL_DIR}"; [ "$DO_CLAUDE" = 1 ] || BASE="$CODEX_DIR"
- COUNT=$(find "$BASE/references" -name '*.md' 2>/dev/null | wc -l | tr -d ' ')
- printf '%s✓ 完成 / Done%s — 參考檔 %s 份 / %s reference files\n\n' "$c_green" "$c_off" "$COUNT" "$COUNT"
- printf '試試看 / Try asking:\n'
- printf ' %s亮度跟明度差在哪?%s\n' "$c_yellow" "$c_off"
- printf ' %sCIEDE2000 為什麼要有旋轉項?%s\n' "$c_yellow" "$c_off"
- if [ "$DO_CLAUDE" = 1 ]; then
- printf ' %s/%s%s ← 手動呼叫\n' "$c_yellow" "$NAME" "$c_off"
- fi
- printf '\n%s其他工具(Cursor / Windsurf / Cline)請見 INSTALL.md%s\n\n' "$c_dim" "$c_off"
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.