Skip to content

Conversation

@Jym77
Copy link
Contributor

@Jym77 Jym77 commented Jan 14, 2026

Prepare for #1966

@changeset-bot
Copy link

changeset-bot bot commented Jan 14, 2026

🦋 Changeset detected

Latest commit: a8b12ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 80 packages
Name Type
@siteimprove/alfa-css Minor
@siteimprove/alfa-cascade Minor
@siteimprove/alfa-css-feature Minor
@siteimprove/alfa-dom Minor
@siteimprove/alfa-painting-order Minor
@siteimprove/alfa-rules Minor
@siteimprove/alfa-selector Minor
@siteimprove/alfa-style Minor
@siteimprove/alfa-aria Minor
@siteimprove/alfa-table Minor
@siteimprove/alfa-web Minor
@siteimprove/alfa-xpath Minor
@siteimprove/alfa-act Minor
@siteimprove/alfa-affine Minor
@siteimprove/alfa-applicative Minor
@siteimprove/alfa-array Minor
@siteimprove/alfa-bits Minor
@siteimprove/alfa-branched Minor
@siteimprove/alfa-cache Minor
@siteimprove/alfa-callback Minor
@siteimprove/alfa-clone Minor
@siteimprove/alfa-collection Minor
@siteimprove/alfa-comparable Minor
@siteimprove/alfa-compatibility Minor
@siteimprove/alfa-continuation Minor
@siteimprove/alfa-device Minor
@siteimprove/alfa-eaa Minor
@siteimprove/alfa-earl Minor
@siteimprove/alfa-either Minor
@siteimprove/alfa-emitter Minor
@siteimprove/alfa-encoding Minor
@siteimprove/alfa-equatable Minor
@siteimprove/alfa-flags Minor
@siteimprove/alfa-fnv Minor
@siteimprove/alfa-foldable Minor
@siteimprove/alfa-functor Minor
@siteimprove/alfa-future Minor
@siteimprove/alfa-generator Minor
@siteimprove/alfa-graph Minor
@siteimprove/alfa-hash Minor
@siteimprove/alfa-http Minor
@siteimprove/alfa-iana Minor
@siteimprove/alfa-iterable Minor
@siteimprove/alfa-json-ld Minor
@siteimprove/alfa-json Minor
@siteimprove/alfa-lazy Minor
@siteimprove/alfa-list Minor
@siteimprove/alfa-map Minor
@siteimprove/alfa-mapper Minor
@siteimprove/alfa-math Minor
@siteimprove/alfa-monad Minor
@siteimprove/alfa-network Minor
@siteimprove/alfa-option Minor
@siteimprove/alfa-parser Minor
@siteimprove/alfa-performance Minor
@siteimprove/alfa-predicate Minor
@siteimprove/alfa-promise Minor
@siteimprove/alfa-record Minor
@siteimprove/alfa-rectangle Minor
@siteimprove/alfa-reducer Minor
@siteimprove/alfa-refinement Minor
@siteimprove/alfa-result Minor
@siteimprove/alfa-rng Minor
@siteimprove/alfa-sarif Minor
@siteimprove/alfa-selective Minor
@siteimprove/alfa-sequence Minor
@siteimprove/alfa-set Minor
@siteimprove/alfa-slice Minor
@siteimprove/alfa-string Minor
@siteimprove/alfa-test Minor
@siteimprove/alfa-thenable Minor
@siteimprove/alfa-thunk Minor
@siteimprove/alfa-time Minor
@siteimprove/alfa-toolchain Minor
@siteimprove/alfa-trampoline Minor
@siteimprove/alfa-tree Minor
@siteimprove/alfa-trilean Minor
@siteimprove/alfa-tuple Minor
@siteimprove/alfa-url Minor
@siteimprove/alfa-wcag Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Jym77 Jym77 changed the title Colorjs.io Use colorjs.io to represent CSS4 colors. Jan 14, 2026
@Jym77 Jym77 self-assigned this Jan 14, 2026
@Jym77 Jym77 added major Backwards-incompatible change that touches public API Language support Related to unsupported features in HTML/CSS/ARIA labels Jan 14, 2026
@github-project-automation github-project-automation bot moved this to 🧑‍💻 Doing in ⚙️ Alfa Development Jan 14, 2026
const serialize = serializer(Gradient.Linear.parse);

const red = color(1, 0, 0);
const lime = color(0, 1, 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remark: Tests that used green now switch to lime. This is because lime is #00FF00, or rgb(0% 100% 0%) while green is #008000, or rgb(0% 50.19607843137255% 0%) (128/255). For the sake of avoiding messy floating point arithmetic in tests, lime is just simpler…

Comment on lines +8 to +10
* The old `RGB`, `Named`, `Hex`, … classes no longer exist. Everything is bundled into a `CC4Color` class. The `#red`, `#green`, `#blue`, `#alpha` getters still exist, returning the components in the sRGB color space.
* The constructors `Color.hsl`, `Color.hex`, … have similarly been removed.
* The `Color.rgb` constructor has been kept as it is used in many places.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will require changes in Dory which is using RGB.of in a few places, notably when building oracles and when marshalling color related diagnostics.

RGB.of will need to be replaced by Color.rgb. The RGBtoColorJSON helper will also need some adaptation, but that should be simplification since the sRGB components are now guaranteed to be Percentage (cannot be Number anymore).

@mvy-siteimprove FYI.

1: Outcomes.IsDistinguishable(
[style, Err.of(spanStyle)],
[addCursor(Ok.of(spanStyle)), addCursor(style)],
[addCursor(style), addCursor(Ok.of(spanStyle))],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the swapping of elements was already present, but simpler color representation made .deepEqual able to ignore it 🤔

@Jym77 Jym77 marked this pull request as ready for review January 15, 2026 09:23
@Jym77 Jym77 requested a review from a team as a code owner January 15, 2026 09:23
@Jym77
Copy link
Contributor Author

Jym77 commented Jan 15, 2026

!pr extract

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language support Related to unsupported features in HTML/CSS/ARIA major Backwards-incompatible change that touches public API

Projects

Status: 🧑‍💻 Doing

Development

Successfully merging this pull request may close these issues.

2 participants