Merge code

This commit is contained in:
2022-05-09 15:00:08 +08:00
parent 117b37b5cf
commit 1ca659dd6a

View File

@@ -280,6 +280,13 @@ val Int.isWhite
(0.2126 * r + 0.7152 * g + 0.0722 * b) >= 128
}
/**
* 调整颜色透明度
* @param value 透明度
* @return [Int] 调整后的颜色
*/
fun Int.colorAlphaOf(value: Float) = safeOfNan { (255.coerceAtMost(0.coerceAtLeast((value * 255).toInt())) shl 24) + (0x00ffffff and this) }
/**
* Base64 加密
* @return [String]