{"id":20778061,"url":"https://github.com/stackgl/gl-clear","last_synced_at":"2025-04-30T18:41:34.614Z","repository":{"id":16935758,"uuid":"19697574","full_name":"stackgl/gl-clear","owner":"stackgl","description":"A helper WebGL module for clearing the current buffer","archived":false,"fork":false,"pushed_at":"2017-04-29T20:18:00.000Z","size":155,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-12T05:05:39.991Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-12T12:20:22.000Z","updated_at":"2022-02-26T17:28:37.000Z","dependencies_parsed_at":"2022-08-30T10:11:00.557Z","dependency_job_id":null,"html_url":"https://github.com/stackgl/gl-clear","commit_stats":null,"previous_names":["hughsk/gl-clear"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-clear","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-clear/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-clear/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-clear/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackgl","download_url":"https://codeload.github.com/stackgl/gl-clear/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251764452,"owners_count":21640060,"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":[],"created_at":"2024-11-17T13:18:57.520Z","updated_at":"2025-04-30T18:41:34.536Z","avatar_url":"https://github.com/stackgl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gl-clear [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nA helper WebGL module for clearing the current buffer – extracted from\n[@mikolalysenko](http://github.com/mikolalysenko)'s\n[gl-now](http://github.com/mikolalysenko/gl-now).\n\n## Usage\n\n[![NPM](https://nodei.co/npm/gl-clear.png)](https://nodei.co/npm/gl-clear/)\n\n### `clear = glClear(options)`\n\nCreates a clear function for you, accepting the following options:\n\n* `color`: An RGBA array for the colors to clear the buffer to, between 0 and 1.\n  Set to `false` to disable.\n* `depth`: A single value to clear the depth buffer to. Set to `false` to disable.\n* `stencil`: A single value to clear the stencil buffer to, disabled by default.\n\n### `clear(gl)`\n\nClears the current buffer on the `gl` context.\n\n### `clear.color = color`\n\nUpdates the clear color. Set to `false` to disable.\n\n### `clear.depth = depth`\n\nUpdates the depth value to clear to. Set to `false` to disable.\n\n### `clear.stencil = stencil`\n\nUpdates the stencil value to clear to. Set to `false` to disable.\n\n## Alternatives\n\nThis module is intended as a small shorthand to WebGL's clear methods.\nThankfully clearing is a simple procedure so you are also welcome to fall back\nonto WebGL's clear methods if `gl-clear` doesn't meet your needs. For example:\n\n``` javascript\n// clear the screen red, and clear the depth buffer:\ngl.clearColor(1, 0, 0, 1)\ngl.clearDepth(1)\ngl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)\n```\n\nIf you've written your own clear module, let us know and we'll link to it\nhere!\n\n## License\n\nMIT. See [LICENSE.md](http://github.com/hughsk/gl-clear/blob/master/LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-clear","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackgl%2Fgl-clear","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-clear/lists"}