TextFieldColors

Class

Common
class TextFieldColors
constructor(
    val focusedTextColor: Color,
    val unfocusedTextColor: Color,
    val disabledTextColor: Color,
    val errorTextColor: Color,
    val focusedContainerColor: Color,
    val unfocusedContainerColor: Color,
    val disabledContainerColor: Color,
    val errorContainerColor: Color,
    val cursorColor: Color,
    val errorCursorColor: Color,
    val textSelectionColors: TextSelectionColors,
    val focusedIndicatorColor: Color,
    val unfocusedIndicatorColor: Color,
    val disabledIndicatorColor: Color,
    val errorIndicatorColor: Color,
    val focusedLeadingIconColor: Color,
    val unfocusedLeadingIconColor: Color,
    val disabledLeadingIconColor: Color,
    val errorLeadingIconColor: Color,
    val focusedTrailingIconColor: Color,
    val unfocusedTrailingIconColor: Color,
    val disabledTrailingIconColor: Color,
    val errorTrailingIconColor: Color,
    val focusedLabelColor: Color,
    val unfocusedLabelColor: Color,
    val disabledLabelColor: Color,
    val errorLabelColor: Color,
    val focusedPlaceholderColor: Color,
    val unfocusedPlaceholderColor: Color,
    val disabledPlaceholderColor: Color,
    val errorPlaceholderColor: Color,
    val focusedSupportingTextColor: Color,
    val unfocusedSupportingTextColor: Color,
    val disabledSupportingTextColor: Color,
    val errorSupportingTextColor: Color,
    val focusedPrefixColor: Color,
    val unfocusedPrefixColor: Color,
    val disabledPrefixColor: Color,
    val errorPrefixColor: Color,
    val focusedSuffixColor: Color,
    val unfocusedSuffixColor: Color,
    val disabledSuffixColor: Color,
    val errorSuffixColor: Color,
)

Represents the colors of the input text, container, and content (including label, placeholder, leading and trailing icons) used in a text field in different states.

Parameters

focusedTextColorthe color used for the input text of this text field when focused
unfocusedTextColorthe color used for the input text of this text field when not focused
disabledTextColorthe color used for the input text of this text field when disabled
errorTextColorthe color used for the input text of this text field when in error state
focusedContainerColorthe container color for this text field when focused
unfocusedContainerColorthe container color for this text field when not focused
disabledContainerColorthe container color for this text field when disabled
errorContainerColorthe container color for this text field when in error state
cursorColorthe cursor color for this text field
errorCursorColorthe cursor color for this text field when in error state
textSelectionColorsthe colors used when the input text of this text field is selected
focusedIndicatorColorthe indicator color for this text field when focused
unfocusedIndicatorColorthe indicator color for this text field when not focused
disabledIndicatorColorthe indicator color for this text field when disabled
errorIndicatorColorthe indicator color for this text field when in error state
focusedLeadingIconColorthe leading icon color for this text field when focused
unfocusedLeadingIconColorthe leading icon color for this text field when not focused
disabledLeadingIconColorthe leading icon color for this text field when disabled
errorLeadingIconColorthe leading icon color for this text field when in error state
focusedTrailingIconColorthe trailing icon color for this text field when focused
unfocusedTrailingIconColorthe trailing icon color for this text field when not focused
disabledTrailingIconColorthe trailing icon color for this text field when disabled
errorTrailingIconColorthe trailing icon color for this text field when in error state
focusedLabelColorthe label color for this text field when focused
unfocusedLabelColorthe label color for this text field when not focused
disabledLabelColorthe label color for this text field when disabled
errorLabelColorthe label color for this text field when in error state
focusedPlaceholderColorthe placeholder color for this text field when focused
unfocusedPlaceholderColorthe placeholder color for this text field when not focused
disabledPlaceholderColorthe placeholder color for this text field when disabled
errorPlaceholderColorthe placeholder color for this text field when in error state
focusedSupportingTextColorthe supporting text color for this text field when focused
unfocusedSupportingTextColorthe supporting text color for this text field when not focused
disabledSupportingTextColorthe supporting text color for this text field when disabled
errorSupportingTextColorthe supporting text color for this text field when in error state
focusedPrefixColorthe prefix color for this text field when focused
unfocusedPrefixColorthe prefix color for this text field when not focused
disabledPrefixColorthe prefix color for this text field when disabled
errorPrefixColorthe prefix color for this text field when in error state
focusedSuffixColorthe suffix color for this text field when focused
unfocusedSuffixColorthe suffix color for this text field when not focused
disabledSuffixColorthe suffix color for this text field when disabled
errorSuffixColorthe suffix color for this text field when in error state

Functions

fun copy(
        focusedTextColor: Color = this.focusedTextColor,
        unfocusedTextColor: Color = this.unfocusedTextColor,
        disabledTextColor: Color = this.disabledTextColor,
        errorTextColor: Color = this.errorTextColor,
        focusedContainerColor: Color = this.focusedContainerColor,
        unfocusedContainerColor: Color = this.unfocusedContainerColor,
        disabledContainerColor: Color = this.disabledContainerColor,
        errorContainerColor: Color = this.errorContainerColor,
        cursorColor: Color = this.cursorColor,
        errorCursorColor: Color = this.errorCursorColor,
        textSelectionColors: TextSelectionColors? = this.textSelectionColors,
        focusedIndicatorColor: Color = this.focusedIndicatorColor,
        unfocusedIndicatorColor: Color = this.unfocusedIndicatorColor,
        disabledIndicatorColor: Color = this.disabledIndicatorColor,
        errorIndicatorColor: Color = this.errorIndicatorColor,
        focusedLeadingIconColor: Color = this.focusedLeadingIconColor,
        unfocusedLeadingIconColor: Color = this.unfocusedLeadingIconColor,
        disabledLeadingIconColor: Color = this.disabledLeadingIconColor,
        errorLeadingIconColor: Color = this.errorLeadingIconColor,
        focusedTrailingIconColor: Color = this.focusedTrailingIconColor,
        unfocusedTrailingIconColor: Color = this.unfocusedTrailingIconColor,
        disabledTrailingIconColor: Color = this.disabledTrailingIconColor,
        errorTrailingIconColor: Color = this.errorTrailingIconColor,
        focusedLabelColor: Color = this.focusedLabelColor,
        unfocusedLabelColor: Color = this.unfocusedLabelColor,
        disabledLabelColor: Color = this.disabledLabelColor,
        errorLabelColor: Color = this.errorLabelColor,
        focusedPlaceholderColor: Color = this.focusedPlaceholderColor,
        unfocusedPlaceholderColor: Color = this.unfocusedPlaceholderColor,
        disabledPlaceholderColor: Color = this.disabledPlaceholderColor,
        errorPlaceholderColor: Color = this.errorPlaceholderColor,
        focusedSupportingTextColor: Color = this.focusedSupportingTextColor,
        unfocusedSupportingTextColor: Color = this.unfocusedSupportingTextColor,
        disabledSupportingTextColor: Color = this.disabledSupportingTextColor,
        errorSupportingTextColor: Color = this.errorSupportingTextColor,
        focusedPrefixColor: Color = this.focusedPrefixColor,
        unfocusedPrefixColor: Color = this.unfocusedPrefixColor,
        disabledPrefixColor: Color = this.disabledPrefixColor,
        errorPrefixColor: Color = this.errorPrefixColor,
        focusedSuffixColor: Color = this.focusedSuffixColor,
        unfocusedSuffixColor: Color = this.unfocusedSuffixColor,
        disabledSuffixColor: Color = this.disabledSuffixColor,
        errorSuffixColor: Color = this.errorSuffixColor,
    ) =
        TextFieldColors(
            focusedTextColor.takeOrElse { this.focusedTextColor },
            unfocusedTextColor.takeOrElse { this.unfocusedTextColor },
            disabledTextColor.takeOrElse { this.disabledTextColor },
            errorTextColor.takeOrElse { this.errorTextColor },
            focusedContainerColor.takeOrElse { this.focusedContainerColor },
            unfocusedContainerColor.takeOrElse { this.unfocusedContainerColor },
            disabledContainerColor.takeOrElse { this.disabledContainerColor },
            errorContainerColor.takeOrElse { this.errorContainerColor },
            cursorColor.takeOrElse { this.cursorColor },
            errorCursorColor.takeOrElse { this.errorCursorColor },
            textSelectionColors.takeOrElse { this.textSelectionColors },
            focusedIndicatorColor.takeOrElse { this.focusedIndicatorColor },
            unfocusedIndicatorColor.takeOrElse { this.unfocusedIndicatorColor },
            disabledIndicatorColor.takeOrElse { this.disabledIndicatorColor },
            errorIndicatorColor.takeOrElse { this.errorIndicatorColor },
            focusedLeadingIconColor.takeOrElse { this.focusedLeadingIconColor },
            unfocusedLeadingIconColor.takeOrElse { this.unfocusedLeadingIconColor },
            disabledLeadingIconColor.takeOrElse { this.disabledLeadingIconColor },
            errorLeadingIconColor.takeOrElse { this.errorLeadingIconColor },
            focusedTrailingIconColor.takeOrElse { this.focusedTrailingIconColor },
            unfocusedTrailingIconColor.takeOrElse { this.unfocusedTrailingIconColor },
            disabledTrailingIconColor.takeOrElse { this.disabledTrailingIconColor },
            errorTrailingIconColor.takeOrElse { this.errorTrailingIconColor },
            focusedLabelColor.takeOrElse { this.focusedLabelColor },
            unfocusedLabelColor.takeOrElse { this.unfocusedLabelColor },
            disabledLabelColor.takeOrElse { this.disabledLabelColor },
            errorLabelColor.takeOrElse { this.errorLabelColor },
            focusedPlaceholderColor.takeOrElse { this.focusedPlaceholderColor },
            unfocusedPlaceholderColor.takeOrElse { this.unfocusedPlaceholderColor },
            disabledPlaceholderColor.takeOrElse { this.disabledPlaceholderColor },
            errorPlaceholderColor.takeOrElse { this.errorPlaceholderColor },
            focusedSupportingTextColor.takeOrElse { this.focusedSupportingTextColor },
            unfocusedSupportingTextColor.takeOrElse { this.unfocusedSupportingTextColor },
            disabledSupportingTextColor.takeOrElse { this.disabledSupportingTextColor },
            errorSupportingTextColor.takeOrElse { this.errorSupportingTextColor },
            focusedPrefixColor.takeOrElse { this.focusedPrefixColor },
            unfocusedPrefixColor.takeOrElse { this.unfocusedPrefixColor },
            disabledPrefixColor.takeOrElse { this.disabledPrefixColor },
            errorPrefixColor.takeOrElse { this.errorPrefixColor },
            focusedSuffixColor.takeOrElse { this.focusedSuffixColor },
            unfocusedSuffixColor.takeOrElse { this.unfocusedSuffixColor },
            disabledSuffixColor.takeOrElse { this.disabledSuffixColor },
            errorSuffixColor.takeOrElse { this.errorSuffixColor },
        )

Returns a copy of this ChipColors, optionally overriding some of the values. This uses the Color.Unspecified to mean “use the value from the source”