Skip to content

Commit

Permalink
rename and move util functions
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartToolFactory committed Apr 30, 2022
1 parent 64b3a4b commit e35d150
Show file tree
Hide file tree
Showing 16 changed files with 1,627 additions and 1,203 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import com.smarttoolfactory.extendedcolors.ColorSwatch
import com.smarttoolfactory.extendedcolors.util.colorToHex

@Composable
fun MaterialColorPicker(onColorChange: (Color) -> Unit) {
fun M2ListColorPicker(onColorChange: (Color) -> Unit) {

var headerIndex by remember { mutableStateOf(0) }
var selectedColorIndex by remember { mutableStateOf(-1) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.ClipboardManager
import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.unit.dp
import com.google.accompanist.pager.ExperimentalPagerApi
import com.google.accompanist.pager.HorizontalPager
import com.google.accompanist.pager.PagerState
import com.google.accompanist.pager.rememberPagerState
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.smarttoolfactory.composecolorsextended.demo.ColorModelConversionDemo
import com.smarttoolfactory.composecolorsextended.demo.GradientAngleDemo
import com.smarttoolfactory.composecolorsextended.demo.MD2ColorSelectionDemo
import com.smarttoolfactory.composecolorsextended.demo.MD3ColorShadeSelectionDemo
import com.smarttoolfactory.composecolorsextended.demo.M2ColorSelectionDemo
import com.smarttoolfactory.composecolorsextended.demo.M3ColorShadeSelectionDemo
import com.smarttoolfactory.composecolorsextended.ui.theme.ComposeColorsExtendedTheme
import com.smarttoolfactory.extendedcolors.util.colorToHSL
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -96,13 +94,14 @@ private fun HomeContent() {
) { page: Int ->

when (page) {
0 -> MD2ColorSelectionDemo {
0 -> M2ColorSelectionDemo {
backgroundColor = it
}
1 -> MD3ColorShadeSelectionDemo {
1 -> M3ColorShadeSelectionDemo {
backgroundColor = it
}
else -> GradientAngleDemo()
2 -> GradientAngleDemo()
else -> ColorModelConversionDemo()
}
}
}
Expand All @@ -111,5 +110,6 @@ internal val tabList =
listOf(
"Material Design2",
"Material You/3",
"Gradient Angles"
"Gradient Angles",
"Model Conversion",
)
Loading

0 comments on commit e35d150

Please sign in to comment.