otpCellState

fun otpCellState(index: Int, value: String, fieldFocused: Boolean, isError: Boolean): OtpCellState

Which cell the caret is on, and how each cell should be painted.

Pure so it is testable without a composition. Note the fieldFocused gate: the source idiom this came from computed isFocused = value.length == index unconditionally, so a cell was painted with the focus ring even when the field held no focus at all — the form looked active while the keyboard was closed. A cell is only active when the field itself is focused.