{"action":"closed","issue":{"url":"https://api.github.com/repos/styled-components/polished/issues/44","repository_url":"https://api.github.com/repos/styled-components/polished","labels_url":"https://api.github.com/repos/styled-components/polished/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/styled-components/polished/issues/44/comments","events_url":"https://api.github.com/repos/styled-components/polished/issues/44/events","html_url":"https://github.com/styled-components/polished/issues/44","id":194903892,"number":44,"title":"Color API","user":{"login":"nikgraf","id":223045,"avatar_url":"https://avatars2.githubusercontent.com/u/223045?v=3","gravatar_id":"","url":"https://api.github.com/users/nikgraf","html_url":"https://github.com/nikgraf","followers_url":"https://api.github.com/users/nikgraf/followers","following_url":"https://api.github.com/users/nikgraf/following{/other_user}","gists_url":"https://api.github.com/users/nikgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/nikgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikgraf/subscriptions","organizations_url":"https://api.github.com/users/nikgraf/orgs","repos_url":"https://api.github.com/users/nikgraf/repos","events_url":"https://api.github.com/users/nikgraf/events{/privacy}","received_events_url":"https://api.github.com/users/nikgraf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-12-12T07:01:35Z","updated_at":"2017-03-04T08:51:25Z","closed_at":"2017-03-04T08:51:25Z","body":"#I told @mxstbr to help out here and especially with the color related API 🙌 Before starting to code I want figure out how you think about the API. There was already some discussion here https://github.com/styled-components/polished/pull/24, but there are a couple things unclear to me. This is a proposal. Please correct me if I'm wrong or you see room for improvement.\r\n\r\n- We want everything color related in the lib to make sure it's properly flow-typed & tested.\r\n- The output of every color related function should be a string.\r\n- We want to create the smallest possible output. For colors without opacity we use hex e.g. `#FF553A`. If possible only 3 characters `#FFF` instead of `#FFFFFF`. In case of opacity we generate `rgba(255,0,0,0.3)`.\r\n- A function might take a string or multiple values e.g. `rgb('22, 255, 0')` and `rgb(22, 255, 0)` and `rgb({ red: 22, green: 255, blue: 0 })`. Not sure about the object structure. Looks handy, but usually I prefer to have one recommended way of doing things and by exposing less possible ways we would enforce it. (We can always add it later)\r\n- Functions like `saturate` accept hex strings or rgb or rgba or hsla strings e.g. `'#FFDDFF'` or `'rgb(22, 255, 0)'`, but don't accept plain single values like rgb (there is no conversion). Otherwise it could get confusion if they accept hsla or rgba. On the other hand if we could accept the object notation, but as said it's not necessary.\r\n- In case of manipulation functions we use a functional style like Rambda with the first argument/arguments being the parameters and the last one the base color. Due the nature of the this API design composition is possible e.g.\r\n\r\n```js\r\n// nesting of function calls\r\nconst prettyRed = saturate(20, darken(10, rgb(100, 0, 0)));\r\nconst prettyBlue = saturate(20, darken(10, rgb(0, 100, 0)));\r\n\r\nconst prettify = compose(\r\n  darken(10),\r\n  saturate(20)\r\n);\r\nconst prettyRed = prettify(rgb(100, 0, 0));\r\nconst prettyBlue = prettify(rgb(0, 100, 0));\r\n```\r\n\r\nNote: please ignore 10 & 20 arguments. I need to learn more about color theory first to understand what parameters make sense.\r\n\r\nWhat do you guys think? @bhough @mxstbr @guzart "}}
{"actor":{"display_login":"nikgraf"}}