HarmonizedColorsOptions.Builder

public static class HarmonizedColorsOptions.Builder
extends Object

java.lang.Object
   ↳ com.google.android.material.color.HarmonizedColorsOptions.Builder


Builder class for specifying options when harmonizing colors.

Summary

Public constructors

Builder()

Public methods

HarmonizedColorsOptions build()
HarmonizedColorsOptions.Builder setColorAttributeToHarmonizeWith(int colorAttributeToHarmonizeWith)

Sets the color attribute to harmonize with.

HarmonizedColorsOptions.Builder setColorAttributes(HarmonizedColorAttributes colorAttributes)

Sets the harmonized color attributes for harmonization.

HarmonizedColorsOptions.Builder setColorResourceIds(int[] colorResourceIds)

Sets the array of color resource ids for harmonization.

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

build

public HarmonizedColorsOptions build ()

Returns
HarmonizedColorsOptions

setColorAttributeToHarmonizeWith

public HarmonizedColorsOptions.Builder setColorAttributeToHarmonizeWith (int colorAttributeToHarmonizeWith)

Sets the color attribute to harmonize with.

Parameters
colorAttributeToHarmonizeWith int: The color attribute provided to harmonize color resources and HarmonizedColorAttributes with.

Returns
HarmonizedColorsOptions.Builder

setColorAttributes

public HarmonizedColorsOptions.Builder setColorAttributes (HarmonizedColorAttributes colorAttributes)

Sets the harmonized color attributes for harmonization.

This method will look up the color resource the attribute points to, and harmonizing the color resource directly. If you are looking to harmonize only color resources, in most cases when constructing HarmonizedColorsOptions,

Parameters
colorAttributes HarmonizedColorAttributes: The HarmonizedColorAttributes that needs to be harmonized.

Returns
HarmonizedColorsOptions.Builder

See also:

setColorResourceIds

public HarmonizedColorsOptions.Builder setColorResourceIds (int[] colorResourceIds)

Sets the array of color resource ids for harmonization.

Parameters
colorResourceIds int: The array of color resource ids that needs to be harmonized.

Returns
HarmonizedColorsOptions.Builder