[ActionScript 3.0] AS3.0 获取像素点的灰度
/** * 获取像素点的灰度 * @color 像素点的颜色值 * @return uint */ function getGray(color:uint):uint { return getR(color) * 0.299 + getG(color) * 0.587 + getB(color) * 0.114; } function getR(color:uint):uint { return color << 8 >>> 24; } function getG(color:uint):uint { return color << 16 >>> 24; } function getB(color:uint):uint { return color << 24 >>> 24; }
------------------------------------------------------------------
Always put yourself in the other's shoes.If you feel that it hurts you,it probably hurts others,too.------------------------------------------------------------------