in hot-reload-devtools/src/main/kotlin/org/jetbrains/compose/devtools/widgets/DtLogo.kt [54:76]
fun DtImage(
image: DtImages.Image,
contentDescription: String = image.description,
tint: Color? = null,
modifier: Modifier = Modifier,
) {
var painter: Painter? by remember { mutableStateOf<Painter?>(null) }
val density = LocalDensity.current
LaunchedEffect(Unit) {
withContext(Dispatchers.IO) {
painter = DtImages.imageAsSvgPainter(image, density).await()
}
}
painter?.let { painter ->
Image(
painter, contentDescription,
colorFilter = tint?.let { tint -> ColorFilter.tint(tint) },
modifier = modifier
)
}
}