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
| const isInt = n => parseInt(n) === n; | |
| const toPrecisionN = precision => n => | |
| Number((n).toPrecision(precision)); | |
| function multiplyInt(a, b) { | |
| const iterable = [...new Array(Math.abs(Math.floor(a)))]; | |
| return iterable.reduce( | |
| acc => a < 0 | |
| ? acc - b |
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
| const isInt = n => parseInt(n) === n; | |
| const toPrecisionN = precision => value => | |
| Number(value.toPrecision(precision)); | |
| function multiplyInt(a, b) { | |
| const iterable = [...Array(Math.abs(Math.floor(a)))]; | |
| return iterable.reduce( | |
| acc => a < 0 |
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
| class HSLGenerator { | |
| constructor(hueLength = 100, options = { lightness: 0.6, saturation: 1 }) { | |
| this.hueIncrement = 360 / Math.sqrt(hueLength ** 2 * 2); | |
| this.saturation = options.saturation * 100; | |
| this.lightness = options.lightness * 100; | |
| this.cache = {}; | |
| } | |
| getColor(y, x) { | |
| const cacheKey = [y, x].join("-"); |
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
| import { css } from "styled-components"; | |
| /** | |
| * Represents an RGB color as a string in the format `rgb(${number},${number},${number})` | |
| * or as a tuple of numbers `[number, number, number]`. | |
| */ | |
| type RGB = `rgb(${number},${number},${number})` | [number, number, number]; | |
| /** | |
| * Props for the `ring` mixin. |
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
| import { writeFile, mkdir } from "fs/promises"; | |
| import { join } from "path"; | |
| import { load } from "cheerio"; // install with `bun add cheerio` | |
| const COLLECTION_URLS = [ | |
| "https://www.svgrepo.com/collection/finance-6/", | |
| "https://www.svgrepo.com/collection/finance-6/2", | |
| ]; | |
| const OUTPUT_DIR = "./public/vectors"; |
OlderNewer