Improve color inspector

Summary:
Before this change, color inspector used a color picker that showed: color, rgba, hex.

The problem is that engineers have to click on it to see these values.

This change leaves the picker as is, but presents both hex and rgba inlined within the inspector thus avoiding extra interactions.

Reviewed By: antonk52

Differential Revision: D41495740

fbshipit-source-id: c8af01e3060d2e6725295418293b1e30679c1b1f
This commit is contained in:
Lorenzo Blasa
2022-11-23 08:31:13 -08:00
committed by Facebook GitHub Bot
parent dbf3108c36
commit ef64abb495
4 changed files with 105 additions and 23 deletions

View File

@@ -29,7 +29,7 @@ data class SpaceBox(val top: Int, val right: Int, val bottom: Int, val left: Int
}
@kotlinx.serialization.Serializable
data class Color(val r: Int, val g: Int, val b: Int, val alpha: Int) {
data class Color(val r: Int, val g: Int, val b: Int, val a: Int) {
companion object {
fun fromColor(color: Int): Color {
val alpha: Int = (color shr 24) and 0xFF / 255