Skip to content

Commit

Permalink
serialize(): Remove stripNone option, since we ended up not needing it
Browse files Browse the repository at this point in the history
  • Loading branch information
LeaVerou committed Sep 3, 2023
1 parent 5a2546e commit e28cd6a
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/serialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ import clone from "./clone.js";
* @param {Object} options
* @param {number} options.precision - Significant digits
* @param {boolean} options.inGamut - Adjust coordinates to fit in gamut first? [default: false]
* @param {boolean} options.stripNone - Strip none values from output (converting them to 0)? [default: false]
*/
export default function serialize (color, {
precision = defaults.precision,
format = "default",
inGamut = true,
stripNone = true,
...customOptions
} = {}) {
let ret;
Expand All @@ -34,11 +32,6 @@ export default function serialize (color, {

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

if (stripNone) {
// Convert NaN to zeros
coords = coords.map(c => c? c : 0);
}

if (inGamut && !checkInGamut(color)) {
// FIXME what happens if the color contains NaNs?
coords = toGamut(clone(color), inGamut === true? undefined : inGamut).coords;
Expand Down

0 comments on commit e28cd6a

Please sign in to comment.