Clarification about how ColorMatrix transformations work

别等时光非礼了梦想. 提交于 2019-12-04 05:05:48
Dan Byström

You are correct that the bottom line is for translation. What Hans is saying in his comment is that there's a scaling factor of 255 involved, which is probably what's confusing you. One way to look at this is that all ARGB values are first divided by 255, then the matrix multiplication is applied and then all values are multiplied back by 255 to give the correct ARGB values. Another way to look at it is to think of the translation values being 255 as big. You will arrive at the same result both ways.

((247/255) * -1 + 1) * 255 = 8
or
247 * -1 + 255 = 8
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!