TextFieldColors


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.

Summary

Public constructors

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

create an instance with arbitrary colors.

Cmn

Public functions

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

Returns a copy of this ChipColors, optionally overriding some of the values.

Cmn
open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn

Public properties

Color

the cursor color for this text field

Cmn
Color

the container color for this text field when disabled

Cmn
Color

the indicator color for this text field when disabled

Cmn
Color

the label color for this text field when disabled

Cmn
Color

the leading icon color for this text field when disabled

Cmn
Color

the placeholder color for this text field when disabled

Cmn
Color

the prefix color for this text field when disabled

Cmn
Color

the suffix color for this text field when disabled

Cmn
Color

the supporting text color for this text field when disabled

Cmn
Color

the color used for the input text of this text field when disabled

Cmn
Color

the trailing icon color for this text field when disabled

Cmn
Color

the container color for this text field when in error state

Cmn
Color

the cursor color for this text field when in error state

Cmn
Color

the indicator color for this text field when in error state

Cmn
Color

the label color for this text field when in error state

Cmn
Color

the leading icon color for this text field when in error state

Cmn
Color

the placeholder color for this text field when in error state

Cmn
Color

the prefix color for this text field when in error state

Cmn
Color

the suffix color for this text field when in error state

Cmn
Color

the supporting text color for this text field when in error state

Cmn
Color

the color used for the input text of this text field when in error state

Cmn
Color

the trailing icon color for this text field when in error state

Cmn
Color

the container color for this text field when focused

Cmn
Color

the indicator color for this text field when focused

Cmn
Color

the label color for this text field when focused

Cmn
Color

the leading icon color for this text field when focused

Cmn
Color

the placeholder color for this text field when focused

Cmn
Color

the prefix color for this text field when focused

Cmn
Color

the suffix color for this text field when focused

Cmn
Color

the supporting text color for this text field when focused

Cmn
Color

the color used for the input text of this text field when focused

Cmn
Color

the trailing icon color for this text field when focused

Cmn
TextSelectionColors

the colors used when the input text of this text field is selected

Cmn
Color

the container color for this text field when not focused

Cmn
Color

the indicator color for this text field when not focused

Cmn
Color

the label color for this text field when not focused

Cmn
Color

the leading icon color for this text field when not focused

Cmn
Color

the placeholder color for this text field when not focused

Cmn
Color

the prefix color for this text field when not focused

Cmn
Color

the suffix color for this text field when not focused

Cmn
Color

the supporting text color for this text field when not focused

Cmn
Color

the color used for the input text of this text field when not focused

Cmn
Color

the trailing icon color for this text field when not focused

Cmn

Public constructors

TextFieldColors

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

create an instance with arbitrary colors. See TextFieldDefaults.colors for the default colors used in TextField. See OutlinedTextFieldDefaults.colors for the default colors used in OutlinedTextField.

Parameters
focusedTextColor: Color

the color used for the input text of this text field when focused

unfocusedTextColor: Color

the color used for the input text of this text field when not focused

disabledTextColor: Color

the color used for the input text of this text field when disabled

errorTextColor: Color

the color used for the input text of this text field when in error state

focusedContainerColor: Color

the container color for this text field when focused

unfocusedContainerColor: Color

the container color for this text field when not focused

disabledContainerColor: Color

the container color for this text field when disabled

errorContainerColor: Color

the container color for this text field when in error state

cursorColor: Color

the cursor color for this text field

errorCursorColor: Color

the cursor color for this text field when in error state

textSelectionColors: TextSelectionColors

the colors used when the input text of this text field is selected

focusedIndicatorColor: Color

the indicator color for this text field when focused

unfocusedIndicatorColor: Color

the indicator color for this text field when not focused

disabledIndicatorColor: Color

the indicator color for this text field when disabled

errorIndicatorColor: Color

the indicator color for this text field when in error state

focusedLeadingIconColor: Color

the leading icon color for this text field when focused

unfocusedLeadingIconColor: Color

the leading icon color for this text field when not focused

disabledLeadingIconColor: Color

the leading icon color for this text field when disabled

errorLeadingIconColor: Color

the leading icon color for this text field when in error state

focusedTrailingIconColor: Color

the trailing icon color for this text field when focused

unfocusedTrailingIconColor: Color

the trailing icon color for this text field when not focused

disabledTrailingIconColor: Color

the trailing icon color for this text field when disabled

errorTrailingIconColor: Color

the trailing icon color for this text field when in error state

focusedLabelColor: Color

the label color for this text field when focused

unfocusedLabelColor: Color

the label color for this text field when not focused

disabledLabelColor: Color

the label color for this text field when disabled

errorLabelColor: Color

the label color for this text field when in error state

focusedPlaceholderColor: Color

the placeholder color for this text field when focused

unfocusedPlaceholderColor: Color

the placeholder color for this text field when not focused

disabledPlaceholderColor: Color

the placeholder color for this text field when disabled

errorPlaceholderColor: Color

the placeholder color for this text field when in error state

focusedSupportingTextColor: Color

the supporting text color for this text field when focused

unfocusedSupportingTextColor: Color

the supporting text color for this text field when not focused

disabledSupportingTextColor: Color

the supporting text color for this text field when disabled

errorSupportingTextColor: Color

the supporting text color for this text field when in error state

focusedPrefixColor: Color

the prefix color for this text field when focused

unfocusedPrefixColor: Color

the prefix color for this text field when not focused

disabledPrefixColor: Color

the prefix color for this text field when disabled

errorPrefixColor: Color

the prefix color for this text field when in error state

focusedSuffixColor: Color

the suffix color for this text field when focused

unfocusedSuffixColor: Color

the suffix color for this text field when not focused

disabledSuffixColor: Color

the suffix color for this text field when disabled

errorSuffixColor: Color

the suffix color for this text field when in error state

Public functions

copy

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

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”

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

Public properties

cursorColor

val cursorColorColor

the cursor color for this text field

disabledContainerColor

val disabledContainerColorColor

the container color for this text field when disabled

disabledIndicatorColor

val disabledIndicatorColorColor

the indicator color for this text field when disabled

disabledLabelColor

val disabledLabelColorColor

the label color for this text field when disabled

disabledLeadingIconColor

val disabledLeadingIconColorColor

the leading icon color for this text field when disabled

disabledPlaceholderColor

val disabledPlaceholderColorColor

the placeholder color for this text field when disabled

disabledPrefixColor

val disabledPrefixColorColor

the prefix color for this text field when disabled

disabledSuffixColor

val disabledSuffixColorColor

the suffix color for this text field when disabled

disabledSupportingTextColor

val disabledSupportingTextColorColor

the supporting text color for this text field when disabled

disabledTextColor

val disabledTextColorColor

the color used for the input text of this text field when disabled

disabledTrailingIconColor

val disabledTrailingIconColorColor

the trailing icon color for this text field when disabled

errorContainerColor

val errorContainerColorColor

the container color for this text field when in error state

errorCursorColor

val errorCursorColorColor

the cursor color for this text field when in error state

errorIndicatorColor

val errorIndicatorColorColor

the indicator color for this text field when in error state

errorLabelColor

val errorLabelColorColor

the label color for this text field when in error state

errorLeadingIconColor

val errorLeadingIconColorColor

the leading icon color for this text field when in error state

errorPlaceholderColor

val errorPlaceholderColorColor

the placeholder color for this text field when in error state

errorPrefixColor

val errorPrefixColorColor

the prefix color for this text field when in error state

errorSuffixColor

val errorSuffixColorColor

the suffix color for this text field when in error state

errorSupportingTextColor

val errorSupportingTextColorColor

the supporting text color for this text field when in error state

errorTextColor

val errorTextColorColor

the color used for the input text of this text field when in error state

errorTrailingIconColor

val errorTrailingIconColorColor

the trailing icon color for this text field when in error state

focusedContainerColor

val focusedContainerColorColor

the container color for this text field when focused

focusedIndicatorColor

val focusedIndicatorColorColor

the indicator color for this text field when focused

focusedLabelColor

val focusedLabelColorColor

the label color for this text field when focused

focusedLeadingIconColor

val focusedLeadingIconColorColor

the leading icon color for this text field when focused

focusedPlaceholderColor

val focusedPlaceholderColorColor

the placeholder color for this text field when focused

focusedPrefixColor

val focusedPrefixColorColor

the prefix color for this text field when focused

focusedSuffixColor

val focusedSuffixColorColor

the suffix color for this text field when focused

focusedSupportingTextColor

val focusedSupportingTextColorColor

the supporting text color for this text field when focused

focusedTextColor

val focusedTextColorColor

the color used for the input text of this text field when focused

focusedTrailingIconColor

val focusedTrailingIconColorColor

the trailing icon color for this text field when focused

textSelectionColors

val textSelectionColorsTextSelectionColors

the colors used when the input text of this text field is selected

unfocusedContainerColor

val unfocusedContainerColorColor

the container color for this text field when not focused

unfocusedIndicatorColor

val unfocusedIndicatorColorColor

the indicator color for this text field when not focused

unfocusedLabelColor

val unfocusedLabelColorColor

the label color for this text field when not focused

unfocusedLeadingIconColor

val unfocusedLeadingIconColorColor

the leading icon color for this text field when not focused

unfocusedPlaceholderColor

val unfocusedPlaceholderColorColor

the placeholder color for this text field when not focused

unfocusedPrefixColor

val unfocusedPrefixColorColor

the prefix color for this text field when not focused

unfocusedSuffixColor

val unfocusedSuffixColorColor

the suffix color for this text field when not focused

unfocusedSupportingTextColor

val unfocusedSupportingTextColorColor

the supporting text color for this text field when not focused

unfocusedTextColor

val unfocusedTextColorColor

the color used for the input text of this text field when not focused

unfocusedTrailingIconColor

val unfocusedTrailingIconColorColor

the trailing icon color for this text field when not focused