{"id":13495294,"url":"https://github.com/g-harel/blobs","last_synced_at":"2025-04-07T05:10:47.729Z","repository":{"id":47263269,"uuid":"164162396","full_name":"g-harel/blobs","owner":"g-harel","description":"random blob generation and animation","archived":false,"fork":false,"pushed_at":"2023-10-01T03:38:11.000Z","size":882,"stargazers_count":146,"open_issues_count":2,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-14T10:15:37.139Z","etag":null,"topics":["blob","generator","svg"],"latest_commit_sha":null,"homepage":"https://blobs.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/g-harel.png","metadata":{"files":{"readme":"README.legacy.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-04T22:51:30.000Z","updated_at":"2024-04-07T04:29:02.000Z","dependencies_parsed_at":"2024-01-16T09:53:51.960Z","dependency_job_id":"7b9f67e5-0d2c-444c-abc4-006f1911067c","html_url":"https://github.com/g-harel/blobs","commit_stats":{"total_commits":249,"total_committers":1,"mean_commits":249.0,"dds":0.0,"last_synced_commit":"c983fef1afbc59a5ee8dc45bafce7305a63c9af8"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-harel%2Fblobs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-harel%2Fblobs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-harel%2Fblobs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-harel%2Fblobs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/g-harel","download_url":"https://codeload.github.com/g-harel/blobs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595335,"owners_count":20963943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blob","generator","svg"],"created_at":"2024-07-31T19:01:33.236Z","updated_at":"2025-04-07T05:10:47.709Z","avatar_url":"https://github.com/g-harel.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"The legacy API exists to preserve compatibility for users importing the package\nusing a `script` tag. Because [unpkg.com](https://unpkg.com) serves the latest\nversion of the package if no version is specified, I can't break backwards\ncompatibility, even with a major release. This API also preserves a few features\nthat could potentially still be useful to some users (guide rendering and\neditable svg).\n\n---\n\n## Install\n\n```ts\n// $ npm install blobs\nconst blobs = require(\"blobs\");\n```\n\n```html\n\u003cscript src=\"https://unpkg.com/blobs\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n```typescript\nconst svg = blobs(options);\n```\n\n![](https://svgsaur.us?t=\u0026w=5\u0026h=32\u0026b=fdcc56)\n![](https://svgsaur.us/?t=WARNING\u0026w=103\u0026h=32\u0026s=16\u0026y=21\u0026x=12\u0026b=feefcd\u0026f=arial\u0026o=b)\n![](https://svgsaur.us?t=\u0026w=1\u0026h=48\u0026)\n\n_Options are **not**\n[sanitized](https://en.wikipedia.org/wiki/HTML_sanitization). Never trust raw\nuser-submitted values in the options._\n\n## Options\n\n#### Required\n\n| Name         | Type     | Description                                  |\n| ------------ | -------- | -------------------------------------------- |\n| `size`       | `number` | Bounding box dimensions (in pixels)          |\n| `complexity` | `number` | Blob complexity (number of points)           |\n| `contrast`   | `number` | Blob contrast (randomness of point position) |\n\n#### Optional\n\n| Name           | Type       | Default    | Description                           |\n| -------------- | ---------- | ---------- | ------------------------------------- |\n| `color`        | `string?`  | `\"none\"`   | Fill color                            |\n| `stroke`       | `object?`  | `...`      | Stroke options                        |\n| `stroke.color` | `string`   | `\"none\"`   | Stroke color                          |\n| `stroke.width` | `number`   | `0`        | Stroke width (in pixels)              |\n| `seed`         | `string?`  | _`random`_ | Value to seed random number generator |\n| `guides`       | `boolean?` | `false`    | Render points, handles and stroke     |\n\n_Either `stroke` or `color` must be defined._\n\n_Guides will use stroke color and width if defined. Otherwise, they default to\n`black` stroke with width of `1`._\n\n##### Example Options Object\n\n```typescript\nconst options = {\n    size: 600,\n    complexity: 0.2,\n    contrast: 0.4,\n    color: \"#ec576b\",\n    stroke: {\n        width: 0,\n        color: \"black\",\n    },\n    guides: false,\n    seed: \"1234\",\n};\n```\n\n## Advanced\n\nIf you need to edit the output svg for your use case, blobs also allows for\n_editable_ output.\n\n```typescript\nconst editableSvg = blobs.editable(options);\n```\n\nThe output of this function is a data structure that represents a nested svg\ndocument. This structure can be changed and rendered to a string using its\n`render` function.\n\n```typescript\neditableSvg.attributes.width = 1000;\nconst svg = editableSvg.render();\n```\n\nNew elements can be added anywhere in the hierarchy.\n\n```typescript\nconst xmlChild = blobs.xml(\"path\");\nxmlChild.attributes.stroke = \"red\";\n// ...\neditableSvg.children.push(xmlChild);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg-harel%2Fblobs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg-harel%2Fblobs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg-harel%2Fblobs/lists"}