[ActionScript 3.0] AS3.0 获取像素点的灰度
2024-10-19 07:40:07
/**
* 获取像素点的灰度
* @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;
}
最新文章
- android服务里生成通知点击后返回正在运行的程序和当前的Activity
- 自定义CollectionViewLayout
- 尝试一下代码高亮。。成功的话明天写一篇blog
- 解决服务器上 w3wp.exe 和 sqlservr.exe 的内存占用率居高不下的方案
- Spring基础—— Bean 的作用域
- 实战Django:简易博客Part1
- [2014-03-13 08:46:42 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
- CreateObject(";Wscript.Shell";)用法
- 网站如何防Session冒名顶替和cookie防篡改
- 状态机的c语言编程
- [每日一题jQuery] jQuery选择器总结:进一步过滤、同级操作、后代操作
- poj2538---字符匹配(映射)
- Win10专业版下图片拖到PS无法打开的解决技巧
- shell 脚本编写 if else then
- MTK Android添加驱动模块
- SAP MM 根据采购订单反查采购申请?
- flask 电子邮件Flask-Mail
- Laravel 项目中编写第一个 Vue 组件
- Linux中实现文本过滤
- shell if [[ ]]的一次应用