Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from color-js:main #15

Merged
merged 37 commits into from
Feb 1, 2025
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3e20e82
Use `fetch()` instead of `readFileSync()` so it works client-side too
LeaVerou Oct 2, 2024
ea1b406
Make `space.js` work both in Node.js and client-side (#600)
DmitrySharabin Oct 4, 2024
a078a42
Avoid style recalculation of all elements on each scroll event (#592)
Inwerpsel Oct 10, 2024
6738c99
Fix return type for deltas function
lloydk Oct 1, 2024
b91ce6e
Remove spaceId from the return type
lloydk Oct 9, 2024
ee0ed30
Create v0.6.0 changelog draft
LeaVerou Oct 24, 2024
f31f98d
Rename v0.6.0 to v0.6.0.md
LeaVerou Oct 24, 2024
07281ad
Avoid mutating objects in Color constructor (#603)
MysteryBlokHed Oct 24, 2024
5f7d7f4
Update v0.6.0.md
svgeesus Oct 24, 2024
b6984aa
Update v0.6.0.md
MysteryBlokHed Oct 25, 2024
5c1536e
Replace `instanceof` checks to work across color.js sources (#605)
MysteryBlokHed Nov 3, 2024
1acd41f
[build] Build color-fn with ESM exports (#606)
MysteryBlokHed Nov 4, 2024
c81c4ea
[oklch] Rename `Oklch` → `OKLCh` (#608)
DmitrySharabin Nov 13, 2024
78dead5
Update the v0.6.0 release notes (#607)
DmitrySharabin Nov 17, 2024
84efd2b
[oklch] Rename `OKLCh` → `OkLCh `
DmitrySharabin Nov 27, 2024
153e262
Update number of installs
LeaVerou Nov 29, 2024
2e9dd5c
Update README.md
LeaVerou Nov 30, 2024
7bc6ff9
Fix parsing 7 character hex colors successfully (#616)
kleinfreund Dec 23, 2024
f1b9193
Update htest.dev to 0.0.15
lloydk Dec 23, 2024
c2178fe
Add funding link to npm package (#618)
MysteryBlokHed Dec 25, 2024
daf657d
Fix failing parse metadata test
lloydk Dec 25, 2024
eb268f9
Update htest to 0.0.16
lloydk Dec 25, 2024
47804df
Update release notes (#621)
DmitrySharabin Dec 25, 2024
a3e8958
[spaces/xyz-d65] Add ref ranges to relative XYZ color spaces (#620)
DmitrySharabin Dec 25, 2024
713e72c
Fix parsing coords that have a minimum range < 0 (#619)
lloydk Dec 26, 2024
3f75ca4
npm update
LeaVerou Dec 26, 2024
68a9449
Update v0.6.0.md
LeaVerou Dec 26, 2024
2978b1d
Release 0.6.0-alpha.1
LeaVerou Dec 26, 2024
adf3d96
Update spaces.d2
LeaVerou Dec 26, 2024
3a96e39
Add links to other Color.js initiatives to README
LeaVerou Dec 26, 2024
148af07
2 fixes for type="custom" ColorSpaces (#628)
sidewayss Jan 3, 2025
168b96b
Fix cam16 and hct type errors (#622)
lloydk Jan 4, 2025
db0479d
Cleanup hsluv tests
lloydk Jan 5, 2025
ffa9c3f
[tests] Add more matrix multiply tests (#594)
epsilonError Jan 11, 2025
db3e23b
[ci] Add workflow to auto-update download count in README (#610)
MysteryBlokHed Jan 31, 2025
09fe3f3
[style] Use Prettier (#626)
MysteryBlokHed Jan 31, 2025
8c80efc
Update README download count
github-actions[bot] Feb 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Avoid mutating objects in Color constructor (color-js#603)
  • Loading branch information
MysteryBlokHed authored Oct 24, 2024
commit 07281ad2d8402a8e9d51223f479747467801a585
4 changes: 4 additions & 0 deletions src/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export default class Color {

if (args.length === 1) {
let parseMeta = {};
// Clone simple objects to avoid mutating original in getColor
if (typeof args[0] === "object" && Object.getPrototypeOf(args[0]).constructor === Object) {
args[0] = { ...args[0] };
}
color = getColor(args[0], {parseMeta});

if (parseMeta.format) {
Expand Down