{"action":"created","issue":{"url":"https://api.github.com/repos/systemed/glug/issues/2","labels_url":"https://api.github.com/repos/systemed/glug/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/systemed/glug/issues/2/comments","events_url":"https://api.github.com/repos/systemed/glug/issues/2/events","html_url":"https://github.com/systemed/glug/issues/2","id":113672315,"number":2,"title":"Darken/lighten functions","user":{"login":"systemed","id":694425,"avatar_url":"https://avatars.githubusercontent.com/u/694425?v=3","gravatar_id":"","url":"https://api.github.com/users/systemed","html_url":"https://github.com/systemed","followers_url":"https://api.github.com/users/systemed/followers","following_url":"https://api.github.com/users/systemed/following{/other_user}","gists_url":"https://api.github.com/users/systemed/gists{/gist_id}","starred_url":"https://api.github.com/users/systemed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systemed/subscriptions","organizations_url":"https://api.github.com/users/systemed/orgs","repos_url":"https://api.github.com/users/systemed/repos","events_url":"https://api.github.com/users/systemed/events{/privacy}","received_events_url":"https://api.github.com/users/systemed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-27T20:01:02Z","updated_at":"2015-10-27T22:47:36Z","closed_at":null,"body":"See enormo-answer at http://stackoverflow.com/questions/5560248/programmatically-lighten-or-darken-a-hex-color-or-rgb-and-blend-colors for some sample code."},"comment":{"url":"https://api.github.com/repos/systemed/glug/issues/comments/151667311","html_url":"https://github.com/systemed/glug/issues/2#issuecomment-151667311","issue_url":"https://api.github.com/repos/systemed/glug/issues/2","id":151667311,"user":{"login":"pnorman","id":1190866,"avatar_url":"https://avatars.githubusercontent.com/u/1190866?v=3","gravatar_id":"","url":"https://api.github.com/users/pnorman","html_url":"https://github.com/pnorman","followers_url":"https://api.github.com/users/pnorman/followers","following_url":"https://api.github.com/users/pnorman/following{/other_user}","gists_url":"https://api.github.com/users/pnorman/gists{/gist_id}","starred_url":"https://api.github.com/users/pnorman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnorman/subscriptions","organizations_url":"https://api.github.com/users/pnorman/orgs","repos_url":"https://api.github.com/users/pnorman/repos","events_url":"https://api.github.com/users/pnorman/events{/privacy}","received_events_url":"https://api.github.com/users/pnorman/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T22:47:36Z","updated_at":"2015-10-27T22:47:36Z","body":"Please please do not darken or lighten in HSL/HSV.\r\n\r\nLch is what I've worked in, but HUSL might work.\r\n\r\nWith [hsul-ruby](https://github.com/husl-colors/husl-ruby) it looks like you could do this with Husl.hex_to_husl, add or subtract to the lightness component, and then do Husl::husl_to_hex.\r\n\r\nThis actually looks simpler than the stackoverflow methods, since all the complexity is in the gem.\r\n\r\nHSV and HSL came about in the 80s with the need to perform color calculations at 30 FPS on hardware less powerful than my calculator. The Lab colour calculations involve non-linear functions which are a big problem on computers without FPUs. Since glug only runs the calculations once when preprocessing to mapbox GL JSON, it's not a performance-critical calculation."}}