Skip to content

Commit cae3d61

Browse files
authored
Merge pull request #8 from LabMobi/feature/SALES-158-allow-access-to-material-colorscheme
Allow access to Material ColorScheme when creating LabTheme
2 parents c946981 + 75617ed commit cae3d61

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22

33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project does not use semantic versioning.
44

5-
## 0.0.8 - [UNRELEASED]
5+
## 0.0.9 - [UNRELEASED]
66

77
### Changed
88

99
- ..
1010

11+
## 0.0.8 - 2025.05.22
12+
13+
### Changed
14+
15+
- Allow to specify the Material `ColorScheme` and `Typography` when creating `LabTheme`. Useful in cases when setting the debug-colors and fonts there has unintended effects.
16+
1117
## 0.0.7 - 2025.05.16
1218

1319
### Changed

lib/src/main/java/mobi/lab/components/compose/theme/LabTheme.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ public fun LabTheme(
3333
dimensions: LabDimensions = LabThemeDefaults.dimensions(),
3434
constants: LabConstants = LabThemeDefaults.constants(),
3535
shapes: LabShapes = LabThemeDefaults.shapes(),
36+
materialColorScheme: ColorScheme = debugColors(),
37+
materialTypography: Typography = debugTypography(),
3638
content: @Composable () -> Unit,
3739
) {
3840
// Make our values available
3941
ProvideLabValues(colors, typography, dimensions, constants, shapes) {
4042
MaterialTheme(
41-
colorScheme = debugColors(),
42-
typography = debugTypography(),
43+
colorScheme = materialColorScheme,
44+
typography = materialTypography,
4345
content = {
4446
// Provide a default TextStyle for all the following content.
4547
// This is inside MaterialTheme to override the default style.
@@ -122,8 +124,8 @@ public val LocalLabShapes: ProvidableCompositionLocal<LabShapes> = staticComposi
122124
}
123125

124126
/**
125-
* A Material [Colors] implementation which sets all colors to [debugColor] to discourage usage of
126-
* [MaterialTheme.colors] in preference to [LabTheme.colors].
127+
* A Material [ColorScheme] implementation which sets all colors to [debugColor] to discourage usage of
128+
* [MaterialTheme.colorScheme] in preference to [LabTheme.colors].
127129
*/
128130
internal fun debugColors(debugColor: Color = Color.Cyan) = ColorScheme(
129131
primary = debugColor,

0 commit comments

Comments
 (0)