Skip to content

Bug: Incorrect parsing of 4-digit hex colors in dimColor #1150

@shalini-saloni

Description

@shalini-saloni

The dimColor function in packages/core/src/highlight/code-to-tokens-ansi.ts incorrectly parses 4-digit hex colors (RGBA short format, e.g., #1234). It treats them as 3-digit hex colors (RGB short format) and ignores the alpha channel.

Expected Result: #1234 should be expanded to #11223322 (approx).
Actual Result: It is treated as #123, resulting in #11223380.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions