[Bug] Difficulty Badge ignores its Accent Color field

Fechada
#331 4 comentários 0 reações 1 responsável Ver no GitHub

Mantenedores costumam responder em até 1 dia

@prakashNalla já está trabalhando nisso.

Desde 30/10/2026.

  • #335 de @prakashNalla — aberto

Avaliação

Esta issue ainda não foi avaliada.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
8
Forks
4
Merge médio
8h 47min
PRs com merge (30d)
157

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de codercops/ogcops

Todas as issues de codercops/ogcops

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.