{"action":"created","issue":{"url":"https://api.github.com/repos/less/less.js/issues/2906","repository_url":"https://api.github.com/repos/less/less.js","labels_url":"https://api.github.com/repos/less/less.js/issues/2906/labels{/name}","comments_url":"https://api.github.com/repos/less/less.js/issues/2906/comments","events_url":"https://api.github.com/repos/less/less.js/issues/2906/events","html_url":"https://github.com/less/less.js/issues/2906","id":158402482,"number":2906,"title":"Contrast Incorrect 2.7.1 ","user":{"login":"ParsonsProjects","id":8460997,"avatar_url":"https://avatars.githubusercontent.com/u/8460997?v=3","gravatar_id":"","url":"https://api.github.com/users/ParsonsProjects","html_url":"https://github.com/ParsonsProjects","followers_url":"https://api.github.com/users/ParsonsProjects/followers","following_url":"https://api.github.com/users/ParsonsProjects/following{/other_user}","gists_url":"https://api.github.com/users/ParsonsProjects/gists{/gist_id}","starred_url":"https://api.github.com/users/ParsonsProjects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParsonsProjects/subscriptions","organizations_url":"https://api.github.com/users/ParsonsProjects/orgs","repos_url":"https://api.github.com/users/ParsonsProjects/repos","events_url":"https://api.github.com/users/ParsonsProjects/events{/privacy}","received_events_url":"https://api.github.com/users/ParsonsProjects/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-06-03T16:12:52Z","updated_at":"2016-08-09T20:13:25Z","closed_at":null,"body":"When using the latest node version 2.7.1 the contrast function seems to be returning incorrectly please see http://codepen.io/ParsonsProjects/pen/ezNWmg when changing the cdn file from 2.7.1 to 2.6.0 the contrast on the body goes from black to white. \r\n\r\nThis is using the color #2f905d to contrast. \r\n\r\nIs this working correctly??"},"comment":{"url":"https://api.github.com/repos/less/less.js/issues/comments/238676217","html_url":"https://github.com/less/less.js/issues/2906#issuecomment-238676217","issue_url":"https://api.github.com/repos/less/less.js/issues/2906","id":238676217,"user":{"login":"demiankatz","id":309069,"avatar_url":"https://avatars.githubusercontent.com/u/309069?v=3","gravatar_id":"","url":"https://api.github.com/users/demiankatz","html_url":"https://github.com/demiankatz","followers_url":"https://api.github.com/users/demiankatz/followers","following_url":"https://api.github.com/users/demiankatz/following{/other_user}","gists_url":"https://api.github.com/users/demiankatz/gists{/gist_id}","starred_url":"https://api.github.com/users/demiankatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demiankatz/subscriptions","organizations_url":"https://api.github.com/users/demiankatz/orgs","repos_url":"https://api.github.com/users/demiankatz/repos","events_url":"https://api.github.com/users/demiankatz/events{/privacy}","received_events_url":"https://api.github.com/users/demiankatz/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T20:13:25Z","updated_at":"2016-08-09T20:13:25Z","body":"I've just run afoul of this problem as well -- the new version of the compiler is choosing black as a contrasting color to #619144 instead of white, which looks wrong to me.\r\n\r\nIn any case, specific colors aside, I think this is a question of interpretation of the spec:\r\n\r\nhttp://lesscss.org/functions/#color-operations-contrast\r\n\r\nMy reading here is that the threshold value is not pointless. The idea here is that you provide a \"light\" color, a \"dark\" color, and a \"threshold.\" If the color we are contrasting is below the threshold, we return the \"light\" color; otherwise, we return the \"dark\" color. This allows fine-grained control of how different colors are picked, and there is no implication of direct comparison between the color being contrasted and the provided light/dark values.\r\n\r\nThe new code as of release 2.7.0 may be smarter about picking the mathematically best contrasting color (though I'm not convinced that picking black as the contrast for #619144 is right even in theory), but it is in any case not behaving according to the specification (assuming I'm interpreting the specification correctly). Being able to use the threshold value to adjust the algorithm does serve a purpose, and some people may actually be depending on it.\r\n\r\nI should also note that I initially noticed this problem because I was comparing outputs between this compiler and a PHP-based one. The JS and PHP code agreed until this change was made... so at least one other developer seems to follow my interpretation of the spec.\r\n\r\nIn any case, compliance with spec is a whole separate question from \"what is the best way to pick a contrasting color?\" If this new logic is working better for some people, maybe a new autocontrast() function needs to be defined that has no threshold parameter, so people who want the new functionality can get it, but people depending on the historical functionality aren't unexpectedly broken."}}
{"actor":{"display_login":"demiankatz"}}