Conversion of the
evaluate method in Android's
ArgbEvaluator from Java to Kotlin.
On the original version, it could take longer to understand what the code is doing. This is because we start working with lower level operations, like extracting the components of the color.
On the Kotlin version, more significant details, like the fact that we are creating a new color, live closer to the function definition. More details about how each operation works can be found by digging into the code if needed. But if we don't need that information, it's dramatically easier to understand what the function does.
Also, on the Java code, it's easier to miss the fact that we are doing a different manipulation to alpha, since it's already relative, to the other componets of the color. On the Kotlin side, it easier to spot the difference.