Skip to content

Commit d24b3a9

Browse files
Material Design Teamhunterstich
authored andcommitted
[M3][Color] Fix formatting and typos for resources harmonization.
PiperOrigin-RevId: 431682174
1 parent 2ae676c commit d24b3a9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/theming/Color.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ an array of resource ids for the color resources you'd like to harmonize, a
409409
HarmonizedColorsOptions options =
410410
new HarmonizedColorsOptions.Builder(activity)
411411
.setColorResourcesIds(colorResources)
412-
.setColorAttributes(new HarmonizedColorAttributes.create(attributes))
412+
.setColorAttributes(HarmonizedColorAttributes.create(attributes))
413413
.setColorAttributeToHarmonizeWith(colorAttributeResId)
414414
.build();
415415
```
@@ -451,17 +451,19 @@ our theme overlay at `R.style.ThemeOverlay_Material3_HarmonizedColors`.
451451

452452
You can also use color resources harmonization separate from dynamic colors if
453453
needed, but the general use case for color resources harmonization is after
454-
dynamic colors have been applied. Here's an example use case to harmonize M3
455-
Error colors by default in the Dynamic Colors callback:
454+
dynamic colors have been applied, to ensure visual cohesion for reserved colors
455+
(e.g. semantic colors) in a M3 theme with dynamic colors enabled. A Material
456+
suggested default when applying dynamic colors, is to harmonize M3 Error colors
457+
in the callback when constructing `DynamicColorsOptions`:
456458

457459
```
458460
DynamicColorsOptions dynamicColorOptions =
459461
new DynamicColorsOptions.Builder(activity)
460462
...
461463
.setOnAppliedCallback(
462464
activity ->
463-
HarmonizedColors.applyIfAvailable(
464-
HarmonizedColorsOptions.createMaterialDefaults(activity)))
465+
HarmonizedColors.applyIfAvailable(
466+
HarmonizedColorsOptions.createMaterialDefaults(activity)))
465467
.build()
466468
DynamicColors.applyIfAvailable(dynamicColorOptions);
467469
```

0 commit comments

Comments
 (0)