Skip to content

{{contrast_text_color}} helper returns incorrect text color #27797

Description

@fueko

Issue Summary

The {{contrast_text_color}} helper returns incorrect text color for many
backgrounds due to a typo in textColorForBackgroundColor from @tryghost/color-utils.

Root cause

In @tryghost/color-utils the YIQ formula uses .b() instead of .blue():

Fix

PR submitted to TryGhost/SDK: TryGhost/SDK#905

Steps to Reproduce

Use light color with the {{contrast_text_color}} helper — the returned contrast color will be white instead of black.

For example: #dacafe, #ffa5b1, #a3e6ff

Ghost Version

6.37.1

Node.js Version

v22.13.1

How did you install Ghost?

localhost

Database type

SQLite3

Browser & OS version

No response

Relevant log / error output

Code of Conduct

  • I agree to be friendly and polite to people in this repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug[triage] something behaving unexpectedlycommunity[triage] Community features and bugsgood first issue[triage] Start here if you've never contributed before.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions