diff --git a/dsl/static/src/common/Helpers.kt b/dsl/static/src/common/Helpers.kt index 9c1597ba..af75104f 100644 --- a/dsl/static/src/common/Helpers.kt +++ b/dsl/static/src/common/Helpers.kt @@ -32,6 +32,10 @@ val Int.gray: Int val Int.opaque: Int get() = this or 0xff000000.toInt() +fun Int.withAlpha(alpha: Int) { + require(alpha >= 0 && alpha <= 0xFF) + return this and 0x00FFFFFF or (alpha shl 24) +} enum class ScreenSize { SMALL, @@ -123,4 +127,4 @@ inline fun Fragment.configuration( fromSdk, sdk, uiMode, nightMode, rightToLeft, smallestWidth)) init() else null } else null -} \ No newline at end of file +}