{"id":38481,"date":"2023-02-15T16:08:40","date_gmt":"2023-02-15T21:08:40","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=38481"},"modified":"2023-02-15T16:08:40","modified_gmt":"2023-02-15T21:08:40","slug":"arbitrary-beautiful-colors","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2023\/02\/15\/arbitrary-beautiful-colors\/","title":{"rendered":"Arbitrary Beautiful Colors"},"content":{"rendered":"<p><a href=\"https:\/\/khanlou.com\/2023\/02\/arbitrary-beautiful-colors\/\">Soroush Khanlou<\/a>:<\/p>\n<blockquote cite=\"https:\/\/khanlou.com\/2023\/02\/arbitrary-beautiful-colors\/\">\n<p>Unfortunately, colors generated like this look really bad. They often come out muddy and ruddy, and generating more than one color doesn&rsquo;t come with any pattern or structure. The colors are all over the place.<\/p>\n<p>This is a structural problem with RGB. RGB is focused on how color is produced, rather than how it&rsquo;s perceived.<\/p>\n<p>Fortunately, the solution to this problem is well documented. There are a few <a href=\"https:\/\/www.mrspeaker.net\/2012\/08\/13\/random-colours-with-hsl\/\">blog<\/a> <a href=\"https:\/\/mika-s.github.io\/javascript\/colors\/hsl\/2017\/12\/05\/generating-random-colors-in-javascript.html\">posts<\/a> out there (warning: JavaScript) that lay out an approach. The idea is this: by using a hue based color space, like HSL, you can hold two parameters constant (saturation and lightness), and modify only the hue, giving you multiple colors that live in the same &ldquo;family&rdquo;.<\/p>\n<p>[&#8230;]<\/p>\n<p>It turns out that the answer I was looking for was in a YouTube video I watched over 10 years ago. The remarkable Vi Hart published a series of videos (<a href=\"https:\/\/www.youtube.com\/watch?v=ahXIMUkSXX0\">one<\/a>, <a href=\"https:\/\/www.youtube.com\/watch?v=lOIP_Z_-0Hs\">two<\/a>, <a href=\"https:\/\/www.youtube.com\/watch?v=14-NdQwKz9w\">three<\/a>) about how plants need to grow their new leaves in such a way that they won&rsquo;t be blocked by the leaves above, which lets them receive maximum sunlight.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Soroush Khanlou: Unfortunately, colors generated like this look really bad. They often come out muddy and ruddy, and generating more than one color doesn&rsquo;t come with any pattern or structure. The colors are all over the place. This is a structural problem with RGB. RGB is focused on how color is produced, rather than how [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2023-02-15T21:08:43Z","apple_news_api_id":"06d1cc97-e111-49f1-9be6-26073bb00d05","apple_news_api_modified_at":"2023-02-15T21:08:43Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/ABtHMl-ERSfGb5iYHO7ANBQ","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[566,34,71,901],"class_list":["post-38481","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-color","tag-graphicdesign","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/38481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=38481"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/38481\/revisions"}],"predecessor-version":[{"id":38482,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/38481\/revisions\/38482"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=38481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=38481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=38481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}