{"id":4922,"date":"2019-03-02T17:15:09","date_gmt":"2019-03-02T09:15:09","guid":{"rendered":"https:\/\/unitycoder.com\/blog\/?p=4922"},"modified":"2019-03-02T17:15:15","modified_gmt":"2019-03-02T09:15:15","slug":"create-gradient-texture-from-array-of-colors","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2019\/03\/02\/create-gradient-texture-from-array-of-colors\/","title":{"rendered":"Create Gradient Texture From Array of Colors"},"content":{"rendered":"\n<p>Small tool to generate gradient Texture2D from array of colors. (Note: maximum colors is 8, since it uses unity Gradient internally ( <a rel=\"noreferrer noopener\" aria-label=\"https:\/\/docs.unity3d.com\/ScriptReference\/Gradient.html (opens in a new tab)\" href=\"https:\/\/docs.unity3d.com\/ScriptReference\/Gradient.html\" target=\"_blank\">https:\/\/docs.unity3d.com\/ScriptReference\/Gradient.html<\/a> ) <\/p>\n\n\n\n<p><strong>Source:<\/strong><br><a href=\"https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/Assets\/Scripts\/Texture\/GradientTextureMaker.cs\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/Assets\/Scripts\/Texture\/GradientTextureMaker.cs<\/a><br><br><strong>Example usage script:<\/strong> (attach script to some 3d object)<br><a rel=\"noreferrer noopener\" aria-label=\"https:\/\/gist.github.com\/unitycoder\/f7ea9019bb67b7042efbd08f0f4fa785 (opens in a new tab)\" href=\"https:\/\/gist.github.com\/unitycoder\/f7ea9019bb67b7042efbd08f0f4fa785\" target=\"_blank\">https:\/\/gist.github.com\/unitycoder\/f7ea9019bb67b7042efbd08f0f4fa785<\/a><br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"637\" height=\"248\" data-attachment-id=\"4923\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2019\/03\/02\/create-gradient-texture-from-array-of-colors\/gradient-texture-maker\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/03\/gradient-texture-maker.png?fit=637%2C248&amp;ssl=1\" data-orig-size=\"637,248\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"gradient-texture-maker\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/03\/gradient-texture-maker.png?fit=637%2C248&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/03\/gradient-texture-maker.png?resize=637%2C248&#038;ssl=1\" alt=\"\" class=\"wp-image-4923\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/03\/gradient-texture-maker.png?w=637&amp;ssl=1 637w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/03\/gradient-texture-maker.png?resize=300%2C117&amp;ssl=1 300w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Small tool to generate gradient Texture2D from array of colors. (Note: maximum colors is 8, since it uses unity Gradient internally ( https:\/\/docs.unity3d.com\/ScriptReference\/Gradient.html ) Source:https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/Assets\/Scripts\/Texture\/GradientTextureMaker.cs Example usage script: (attach script to some 3d object)https:\/\/gist.github.com\/unitycoder\/f7ea9019bb67b7042efbd08f0f4fa785<\/p>\n","protected":false},"author":1,"featured_media":4923,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[96,428,1080,549,701],"class_list":["post-4922","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-array","tag-create","tag-generate","tag-gradient","tag-texture2d"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/03\/gradient-texture-maker.png?fit=637%2C248&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-1ho","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=4922"}],"version-history":[{"count":1,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4922\/revisions"}],"predecessor-version":[{"id":4924,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4922\/revisions\/4924"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/4923"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=4922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=4922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=4922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}