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

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

merged 37 commits into from
Feb 1, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented Oct 3, 2024

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

LeaVerou and others added 30 commits October 2, 2024 13:49
* Fix typo

* Make it work both in Node.js and client-side

* No need to use relative URL
* Avoid style recalculation on scroll events

The previous code depended on getting the scrolled amount through a custom property on the root element.

This caused laggy scrolling and can be avoided by using `position: sticky`, which has the same behavior as the previous code.

The best way to do this is by changing the markup to be similar to the `/api` pages, which use a separate stylesheet. It uses a grid that allows the sticky element to have space next to the main content. For the other pages, the submenu is actually inside of the main content container and relies on `position: fixed` to escape it.

However such a markup change would need a lot of CSS adaptations. Hence this commit solves it with CSS only instead, in a way that is very unlikely to affect other elements on the page.

* Use available space, like `fit-content` did before

* Use local --_gap CSS variable for TOC spacing
The inferred type generated by Typescript for the result of the
deltas function was incorrect. The space property had a type of
string | ColorSpace when it should have been ColorSpace.

A new type called DeltasReturn has been added to fix the issue.
Two thirds
Removes PR's I made that were either already mentioned or which had
trivial changes not worth mentioning.
* Replace `instanceof` checks to work across color.js sources

Instead of relying solely on `instanceof` to check if an argument is an
instance of some class (eg. Color or ColorSpace), also checks the name
of the constructors of the instance to see if any of them have the same
name as the target class.

This method isn't perfect, but it should work well enough given that it
seems unlikely for a user of color.js to define their own unrelated
class whose name conflicts with the library.

* fix: Remove `break` in `isInstance` function

Forgot to remove this after debugging.

* Remove static `is` functions and change isInstance signature

* Update JSDoc description for isInstance

* [types] Remove obsolete ColorSpace test

* [types] Remove obsolete Color test

* [types] Add direct isInstance tests

* Use isInstance in getColor.js

* Update `getColor` space check

Checks if the space is a string instead of checking if it's not a
`ColorSpace` instance.

* Mention #605 in changelog

* Add author @ to changelog

Co-authored-by: Lea Verou <[email protected]>

---------

Co-authored-by: Lea Verou <[email protected]>
* [build] Build color-fn with ESM exports

* Update changelog

Figured this makes the most sense under the "API" heading, but could
move it to a new bugfix category if desired.

* Add author @ to changelog
* Remove already mentioned PRs

* Remove tiny PRs

* Move the PRs in the sections they belong
Go with the name the creator uses. Resolved in #608 (comment)
Fix parsing color strings in hexadecimal notation with 7 character successfully. This is caused by the sRGB color space's tex test regexp allowing a match of 3 valid characters followed by a match of 4 valid characters (and vice-versa). The fix is done by separating the regexp for the collpased and non-collapsed forms.

Add four tests for invalid hex color strings with invalid lengths. Three of them (those for 2, 5, and 9 characters) pass without this fix. Only the one for 7 characters doesn't already.
sidewayss and others added 7 commits January 3, 2025 11:47
Co-authored-by: Lea Verou <[email protected]>
Co-authored-by: Sideways S. <[email protected]>
* Fix cam16 and hct type errors

Add additional types, @ts-expect-error comments and some minor code
changes to fix all typescript errors in the cam16 and hct modules.

* Narrow number[] types to [number, number, number]

Co-authored-by: Adam Thompson-Sharpe <[email protected]>

---------

Co-authored-by: Adam Thompson-Sharpe <[email protected]>
Fix crash due to a missing file.

Simplify tests by only dealing with coords and not
creating PlainColorObjects.

Delete util.mjs and move the readTestData function to
the hsluv.js test module.
* Add tests with vector as first argument

* Add tests for 1x1 vector/matrix edge case

* Update test name for specialized matrix & vector multiply, and add util functions

* Skip unsupported tests

* fix typos
* [ci] Add workflow to auto-update downloads

This workflow runs a bash script to pull the latest download count from
npm, and update the README.md number if the new value is larger.

* [ci] Round download count number

* [ci] Tweak download count script

Makes the regex match look for the exact same string as sed does.
Probably won't actually matter, but doesn't hurt to do.
* [style] Use Prettier and format src/

* [style] Apply Prettier to remaining files

* [style] Preserve matrix formatting in cat-mat script

* [style] Run Prettier without ESLint fix

* [style] Use Stroustrup braces with Prettier

* [style] Use prettier-plugin-space-before-function-paren

* [style] Use prettier-plugin-merge

* [style] Upgraade prettier-plugin-space-before-function-paren

* [style] Run Prettier on missed files

* [style] Manually add spacing to broken area

* [style] Remove ESLint bracket spacing rule

* [style] Remove ESLint stylistic
@pull pull bot merged commit 8c80efc into shaoyuer:main Feb 1, 2025
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.

9 participants