利用颜色的RGB值,通过公式 g = R*0.299 + G*0.587 + B*0.114 求出g, g越小颜色越深 转载于:https://www.cnblogs.com/mystory/p/3384510.html