Skip to content

Commit

Permalink
Add comment for workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydk committed Feb 10, 2024
1 parent 902d173 commit e7ed648
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/serialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export default function serialize (color, {
?? color.space.getFormat("default")
?? ColorSpace.DEFAULT_FORMAT;

// The assignment to coords and inGamut needs to stay in the order they are now
// The order of the assignment was changed as a workaround for a bug in Next.js
// See this issue for details: https://github.com/color-js/color.js/issues/260

let coords = color.coords.slice(); // clone so we can manipulate it

inGamut ||= format.toGamut;
Expand Down

0 comments on commit e7ed648

Please sign in to comment.