{"action":"created","issue":{"url":"https://api.github.com/repos/melonjs/melonJS/issues/841","repository_url":"https://api.github.com/repos/melonjs/melonJS","labels_url":"https://api.github.com/repos/melonjs/melonJS/issues/841/labels{/name}","comments_url":"https://api.github.com/repos/melonjs/melonJS/issues/841/comments","events_url":"https://api.github.com/repos/melonjs/melonJS/issues/841/events","html_url":"https://github.com/melonjs/melonJS/issues/841","id":191854466,"number":841,"title":"[WebGL] setColor override the `globalApha` value","user":{"login":"obiot","id":4033090,"avatar_url":"https://avatars.githubusercontent.com/u/4033090?v=3","gravatar_id":"","url":"https://api.github.com/users/obiot","html_url":"https://github.com/obiot","followers_url":"https://api.github.com/users/obiot/followers","following_url":"https://api.github.com/users/obiot/following{/other_user}","gists_url":"https://api.github.com/users/obiot/gists{/gist_id}","starred_url":"https://api.github.com/users/obiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obiot/subscriptions","organizations_url":"https://api.github.com/users/obiot/orgs","repos_url":"https://api.github.com/users/obiot/repos","events_url":"https://api.github.com/users/obiot/events{/privacy}","received_events_url":"https://api.github.com/users/obiot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-27T10:42:18Z","updated_at":"2016-11-28T01:32:15Z","closed_at":null,"body":"The following code does not work, and will result in a global alpha value of 1.0\r\n\r\n```javascript\r\nrenderer.setGlobalAlpha(0.5);\r\nrenderer.setColor(\"black\");\r\n```\r\n\r\nthe reason being that the webgl renderer store the global alpha value in the [`currentColor`](https://github.com/melonjs/melonJS/blob/master/src/video/webgl/webgl_renderer.js#L509) property, that is then overriden when calling [`setColor`](https://github.com/melonjs/melonJS/blob/master/src/video/webgl/webgl_renderer.js#L520)\r\n\r\nworkaround is to specify the alpha together with the color\r\n```javascript\r\nrenderer.setColor(\"#00000080\");\r\n```\r\nthe canvas renderer has the correct behaviour (in my opinion).\r\n"},"comment":{"url":"https://api.github.com/repos/melonjs/melonJS/issues/comments/263164262","html_url":"https://github.com/melonjs/melonJS/issues/841#issuecomment-263164262","issue_url":"https://api.github.com/repos/melonjs/melonJS/issues/841","id":263164262,"user":{"login":"obiot","id":4033090,"avatar_url":"https://avatars.githubusercontent.com/u/4033090?v=3","gravatar_id":"","url":"https://api.github.com/users/obiot","html_url":"https://github.com/obiot","followers_url":"https://api.github.com/users/obiot/followers","following_url":"https://api.github.com/users/obiot/following{/other_user}","gists_url":"https://api.github.com/users/obiot/gists{/gist_id}","starred_url":"https://api.github.com/users/obiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obiot/subscriptions","organizations_url":"https://api.github.com/users/obiot/orgs","repos_url":"https://api.github.com/users/obiot/repos","events_url":"https://api.github.com/users/obiot/events{/privacy}","received_events_url":"https://api.github.com/users/obiot/received_events","type":"User","site_admin":false},"created_at":"2016-11-28T01:32:15Z","updated_at":"2016-11-28T01:32:15Z","body":"I feel like we did fix that in the past... although i could not find it in the history... maybe in a branch that was never merged into master then!"}}
{"actor":{"display_login":"obiot"}}