package io.scanbot.sdk.reactnative.extensions import android.content.res.Resources import io.scanbot.sdk.ui_v2.common.ScanbotColor fun Int.toPx(resources: Resources): Int { return (this * resources.displayMetrics.density).toInt() } fun Double.toPx(resources: Resources): Int { return (this * resources.displayMetrics.density).toInt() } object Utils { fun tryToParseRGBAHexColor(colorString: String): Int? { return try { ScanbotColor(colorString, false).toAndroid() } catch (ex: Exception) { null } } }