[Bug] Difficulty Badge ignores its Accent Color field

已關閉
#331 4 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@prakashNalla 已經在處理了。

開始於 2026年10月30日。

  • #335 來自 @prakashNalla —— 未關閉

評估

這個 Issue 還沒有評估資料。

描述

bug hacktoberfest

Describe the bug
The Difficulty Badge template has an Accent Color field, but changing it does nothing. src/templates/tutorial/difficulty-badge.ts adds commonFields.accentColor to fields and sets a default of #E07A5F, but render never reads params.accentColor. The bar colours come from the fixed difficultyConfig (green, amber, red), and nothing else in the image uses the accent.

To Reproduce

  1. Go to https://og.codercops.com/create/tutorial?template=tutorial-difficulty-badge and open Customize
  2. Change Accent Color to anything
  3. The preview doesn't change

The API is the same: /api/og?template=tutorial-difficulty-badge&accentColor=%232563EB renders the same image as the default.

Expected behavior
Either the accent shows up somewhere in the image, or the template doesn't offer the field.

Actual behavior
The field is there and the image ignores it.

Environment

  • Browser: Chrome
  • OS: macOS

Additional context
Since the difficulty colours mean something, I'd remove accentColor from fields and defaults rather than recolour the bars, and add a test in tests/templates/ that the template doesn't expose it. If you'd rather keep it, I can use it for the duration pill instead.

主要語言
TypeScript
星號
8
分支
4
平均合併
8 小時 44 分鐘
30 天內合併 PR
158

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

codercops/ogcops 的其他 Issue

查看 codercops/ogcops 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。