Created
September 22, 2021 15:25
-
-
Save Accudio/0117fa81e3c513010faaa27b980f423f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sizes(300, 1360, 0.15) | |
| function sizes(start, stop, tol = 0.1) { | |
| if (start === stop) return [start] | |
| const resolutions = [] | |
| while (start < stop) { | |
| resolutions.push(Math.ceil(start)) | |
| start *= 1 + tol * 2 | |
| } | |
| if (resolutions.at(-1) < stop) { | |
| resolutions.push(stop) | |
| } | |
| return resolutions | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment