mojira.dev
MC-299595

Incorrect text color when using 3-digit hex codes

When using 3-digit hex codes to display text, the shown color doesn’t match the expected color.
For example, using #0F0 should show the same green color as #00FF00, instead it appears as a dark blue.
Using 6-digit hex codes works as expected.

Steps to reproduce:
1. Run the following command: `/title @s title [{"color":"#0F0","text":"Hello!"}]`
2. Observe the color of the displayed text, which appears as dark blue instead of green.

Expected result:
The text should be displayed as green. #0F0 and #00FF00 are equivalent hex color codes.

Observed result:
The text appears as dark blue.

Linked issues

Comments 1

This feature actually works as intended. You see, RGB values don't work like that. Instead, the actual input of hex colors is: RRGGBB. So what you effectively did is #0000F0, which results in Dark Blue.

100percentme

(Unassigned)

Unconfirmed

(Unassigned)

1.21.7

Retrieved