Skip to content

Conversation

@DJMcNab
Copy link
Member

@DJMcNab DJMcNab commented Dec 22, 2025

Follow-up from #1328

The new formatting looks like:

...
{
  "x": 1,
  "y": 18,
  "reference": "#ece5f2",
  "actual": "#bfffbf",
  "difference": [
    -45,
    26,
    -51,
    0
  ]
},
{
  "x": 2,
  "y": 1,
  "reference": "#d9cce5",
  "actual": "#7fff7f",
  "difference": [
    -90,
    51,
    -102,
    0
  ]
},
...

I've also tweaked the in-repo settings of vscode to show the colour picker in these diff files:
image

Follow-up from
linebender#1328

The new formatting looks like:
```json
...
{
  "x": 1,
  "y": 18,
  "reference": "#ece5f2",
  "actual": "#bfffbf",
  "difference": [
    -45,
    26,
    -51,
    0
  ]
},
{
  "x": 2,
  "y": 1,
  "reference": "#d9cce5",
  "actual": "#7fff7f",
  "difference": [
    -90,
    51,
    -102,
    0
  ]
},
...
```
Copy link
Collaborator

@grebmeg grebmeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow-up! The implementation looks easier than I thought it would be. I’d keep the numeric values alongside the hex values, since I have a feeling that will make debugging easier, especially if AI is involved. I don’t have strong evidence for that, just an assumption.

Also, what do you think about using reference and actual names of the same length to make eye-scanning easier, for example ref/act/diff or maybe source/target?

@DJMcNab
Copy link
Member Author

DJMcNab commented Dec 22, 2025

On keeping the full decimal values around, personally I'm not convinced that adds any value. The motivation for this PR was to remove the verbosity that keeping the numbers fully required. I also think that an LLM is likely to be more "familiar" with hex formatted colours than lists of u8 components. Unless you have evidence that it's needed, I'd much prefer to leave it out.

On matching the lengths, that's a very good idea. It's important to keep the old and the new distinct/make it clear which is which, so I'll workshop the names tomorrow. reference and observed, which spring to mind, are a bit too "cute". Maybe target and actual?

@grebmeg
Copy link
Collaborator

grebmeg commented Dec 23, 2025

On keeping the full decimal values around, personally I'm not convinced that adds any value. The motivation for this PR was to remove the verbosity that keeping the numbers fully required. I also think that an LLM is likely to be more "familiar" with hex formatted colours than lists of u8 components. Unless you have evidence that it's needed, I'd much prefer to leave it out.

Yeah, I don’t have it, so let’s leave it as it is. Thank you!

On matching the lengths, that's a very good idea. It's important to keep the old and the new distinct/make it clear which is which, so I'll workshop the names tomorrow. reference and observed, which spring to mind, are a bit too "cute". Maybe target and actual?

I like target/actual and agree that clearer naming here would help. Some other options I like: gold/test, source/actual, and expect/actual.

@DJMcNab DJMcNab enabled auto-merge December 23, 2025 13:39
@DJMcNab DJMcNab added this pull request to the merge queue Dec 23, 2025
Merged via the queue into linebender:main with commit 48f3853 Dec 23, 2025
17 checks passed
@DJMcNab DJMcNab deleted the hex_cereal branch December 23, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants