{"id":13664943,"url":"https://github.com/greggman/hsva-unity","last_synced_at":"2025-09-20T08:18:07.783Z","repository":{"id":31644585,"uuid":"35209847","full_name":"greggman/hsva-unity","owner":"greggman","description":"A Hue Saturation Value adjustment shader for Unity. Useful for making lots of character colors.","archived":false,"fork":false,"pushed_at":"2016-12-02T02:44:09.000Z","size":1832,"stargazers_count":213,"open_issues_count":3,"forks_count":32,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-09-09T01:43:37.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"GLSL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greggman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-07T09:03:02.000Z","updated_at":"2025-08-31T13:33:53.000Z","dependencies_parsed_at":"2022-09-10T11:00:18.563Z","dependency_job_id":null,"html_url":"https://github.com/greggman/hsva-unity","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/greggman/hsva-unity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greggman%2Fhsva-unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greggman%2Fhsva-unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greggman%2Fhsva-unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greggman%2Fhsva-unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greggman","download_url":"https://codeload.github.com/greggman/hsva-unity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greggman%2Fhsva-unity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276064496,"owners_count":25579028,"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","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-08-02T05:03:12.802Z","updated_at":"2025-09-20T08:18:07.711Z","avatar_url":"https://github.com/greggman.png","language":"GLSL","readme":"HSV Shader for Unity\n====================\n\nThis is a selective hue saturation value adjuster for Unity.\n\n\u003cimg src=\"images/hsva-bird.gif\" /\u003e\n\nI've used it in a couple of [unity](http://github.com/greggman/hft-unity2dplatformer)\n[projects](http://github.com/greggman/hft-unity-multi-game-example) to generate different color\ncharacters rather than use different textures. I'm sure there are other\nmaybe even better ways but this worked for me.\n\n\u003cimg src=\"images/birds.png\" width=\"614\" height=\"512\" /\u003e\n\nIt works by letting you set a hue, saturation, value, and alpha\nadjustment. Each value goes from -1 to 1. So for example setting\nthe saturation to 1 would make everything the maximum saturation.\nSetting it 0 means leave it as is. Setting to -1 means remove\nall saturation.\n\n\u003cimg src=\"images/material-settings.png\" /\u003e\n\nYou can think of hue as a color wheel going from 0 to 1 (normally it would go from 0 to 360 degrees but\nshaders work better with numbers that go form 0 to 1).\n\nSo, setting the hue adjustment to 0.5 moves all the colors half way around the color wheel. Setting it\nto -0.2 would move them backward 20% of the way around the color wheel.\n\n\u003cimg src=\"images/hsva-rainbow.gif\" /\u003e\n\nFinally you can set an affect range by hue. Only colors inside that range will be effected.\nThis let's you take a character, like the bird at the top, figure out what hue range is body\nis in, and only effect his body. His beak and his outline are not effected.\n\nThis should work with more complex characters as well as long as the area you want to affect\ncan be isolated by hue range.\n\n\u003cimg src=\"images/hsva-miyamoto.gif\" /\u003e\n\nThe easist way to find a range is to load up a sprite, set the hue adjust to 0.5 (half way around\nthe color wheel) and then adjust the min and max until only the part of the sprite you want\nadjusted matches the range. Once you have that figured out you be good to go\n\nYou can [download or copy and paste the shader from here](https://github.com/greggman/hsva-unity/blob/master/Assets/Shaders/HSVRangeShader.shader).\n\n### HSL version\n\nThere is an HSL version of this shader as well. It uses the HSL color space instead of the HSV color\nspace. The results are different. For example saturating a yellow gradient seems to work better\nwith this shader.\n\nYou can [download or copy and paste the shader from here](https://github.com/greggman/hsva-unity/blob/master/Assets/Shaders/HSLRangeShader.shader).\n\n### License\n\nMIT License\n\nCopyright 2015, Gregg Tavares.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n*   Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n*   Redistributions in binary form must reproduce the above\n    copyright notice, this list of conditions and the following disclaimer\n    in the documentation and/or other materials provided with the\n    distribution.\n\n*   Neither the name of Gregg Tavares. nor the names of its\n    contributors may be used to endorse or promote products derived from\n    this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n### Attribution for the art\n\n---\n#### Bird\n\n*   author: Nooks\n*   url: http://forums.tigsource.com/index.php?topic=9353.0\n\n---\n#### Super Miyamoto\n\n*   author: larsiusprime\n*   url: http://opengameart.org/content/super-miyamoto\n*   license: CC-BY 3.0\n\n\n\n\n","funding_links":[],"categories":["GLSL","Sprite"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreggman%2Fhsva-unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreggman%2Fhsva-unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreggman%2Fhsva-unity/lists"}