[Bug] Difficulty Badge ignores its Accent Color field

Đã đóng
#331 4 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@prakashNalla đang làm issue này rồi.

Từ ngày 30/10/2026.

  • #335 của @prakashNalla — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
8
Fork
4
Merge trung bình
8 giờ 47 phút
Pull request đã merge (30 ngày)
157

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codercops/ogcops

Tất cả issue của codercops/ogcops

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.