ProCraft for Android: An Android native painting app written in Rust
Rust
fix(ui): light interface on every screen; set icon picker
Joshd7878ff2b9b7
diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/canvas/CanvasViewModel.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/canvas/CanvasViewModel.ktindex 887e21d..06d6eaf 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/canvas/CanvasViewModel.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/canvas/CanvasViewModel.kt@@ -357,6 +357,7 @@ class CanvasViewModel(app: Application) : AndroidViewModel(app) {fun changeLightInterface(on: Boolean) {lightInterface = onio.github.artcraftandroid.procraft.ui.Pc.light = on+ session?.setLightInterface(on)interfacePrefs.edit().putBoolean(LIGHT_INTERFACE, on).apply()}@@ -1770,6 +1771,7 @@ class CanvasViewModel(app: Application) : AndroidViewModel(app) {if (memory.totalMem > 0) io.github.artcraftandroid.procraft.core.setLayerBudget((memory.totalMem / 4).toULong())s.setSelectionVisibility(selectionVisibility)s.setBrushScaling(brushOnScreen)+ s.setLightInterface(lightInterface)// as it was left, or fittedif (!orientationMemory) s.forgetSavedView()s.setInputSettings(inputStabilization, inputMotionFiltering, inputMotionExpression, inputPressureSmoothing, inputCurve.flatMap { listOf(it.x, it.y) })@@ -2974,6 +2976,8 @@ class CanvasViewModel(app: Application) : AndroidViewModel(app) {// the brush library stays open under it, so Cancel and Done go back to itif (panel != Panel.BRUSHES) closePanels()studioName = s.studioBegin()+ // each visit's pad paints in white, black with the light interface+ padColor = if (lightInterface) PAD_BLACK else PAD_WHITEreadStudio()studioOpen = true}@@ -3157,7 +3161,8 @@ class CanvasViewModel(app: Application) : AndroidViewModel(app) {/** The drawing pad's canvas is made: dark, painting with the brush being edited, keeping its strokes. */fun startPad(p: CanvasSession) {pad = p- p.setBackgroundColor(PAD_BACK, PAD_BACK, PAD_BACK, true)+ val back = if (lightInterface) PAD_BACK_LIGHT else PAD_BACK+ p.setBackgroundColor(back, back, back, true)p.keepStrokes()syncPad()}@@ -5292,7 +5297,10 @@ class CanvasViewModel(app: Application) : AndroidViewModel(app) {/** The drawing pad's colours (0xRRGGBB), the white one, and its background's grey. */val PAD_COLORS = listOf(0xF83045, 0xFCBD03, 0x85D921, 0x2BB5E6, 0x4956A5, 0xDA3D92, 0xFFFFFF, 0x000000)const val PAD_WHITE = 6+ const val PAD_BLACK = 7const val PAD_BACK = 31f / 255f+ /** With the light interface the pad is light and paints in black. */+ const val PAD_BACK_LIGHT = 243f / 255f/** How long after a studio control stops moving its sample stroke is drawn again (milliseconds). */const val STUDIO_PREVIEW_DELAY_MS = 60L/** Bloom's size and burn sliders when painted on. */diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ActionsPanel.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ActionsPanel.ktindex 569475e..5d70a0c 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ActionsPanel.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ActionsPanel.kt@@ -87,12 +87,13 @@ private class Slide(val label: String, val value: String, val fraction: Float, v/** The pages the panel shows: its tabs, or a page of settings reached from one of them. */private enum class ActionsPage { TABS, PRESSURE, CURSOR }-private val CurveFill = Color(0xFF262626)+private val CurveFill get() = if (Pc.light) Color(0xFFE7E7E9) else Color(0xFF262626)/** Advanced cursor's section headings: bold, as large as the rows, lighter than the tabs' names. */private val CursorHeading get() = if (Pc.light) Pc.TabIdle else Color(0xFFB5B5B5)-private val CurveEdge = Color(0xFF666666)-private val CurveGrid = Color(0xFF353535)+private val CurveEdge get() = if (Pc.light) Color(0xFF999999) else Color(0xFF666666)+private val CurveGrid get() = if (Pc.light) Color(0xFFCACACA) else Color(0xFF353535)+private val CurveLine get() = if (Pc.light) Color.Black else Color.White/** A fraction shown as the panel's sliders show it: "None" at nothing, else a percentage. */private fun percent(v: Float) = if (v <= 0f) "None" else "%.1f%%".format(v * 100f)@@ -567,7 +568,7 @@ private fun PressurePage(vm: CanvasViewModel, onBack: () -> Unit) {Spacer(Modifier.height(24.dp))Text("App Pressure Sensitivity", color = Pc.SlideLabel, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, modifier = Modifier.padding(start = 13.dp).height(19.dp))Box(Modifier.padding(horizontal = 7.dp).fillMaxWidth().aspectRatio(1f).background(CurveFill)) {- PressureCurve(vm.inputCurve, Modifier.fillMaxSize(), grid = CurveGrid, edge = CurveEdge) { vm.changeInput(curve = it) }+ PressureCurve(vm.inputCurve, Modifier.fillMaxSize(), grid = CurveGrid, edge = CurveEdge, line = CurveLine) { vm.changeInput(curve = it) }}Spacer(Modifier.height(27.dp))Group(listOf(Act("Reset all") { vm.resetInput() }))diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/AdjustmentsUi.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/AdjustmentsUi.ktindex 295d7a3..9e18b27 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/AdjustmentsUi.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/AdjustmentsUi.kt@@ -62,11 +62,12 @@ import io.github.artcraftandroid.procraft.core.QuickShapeKindimport io.github.artcraftandroid.procraft.core.LiquifyKindimport kotlin.math.roundToInt-private val ModeBar = Color(0xFF5A5A5A)-private val ModeText = Color(0xFFC5C5C5)-private val HsbPanelFill = Color(0xF71E1E1E)-private val HsbLabel = Color(0xFF808080)-private val HsbValue = Color(0xFFEDEDED)+// light: the band see-through (241 over white, 228 over the surround), the panel near white+private val ModeBar get() = if (Pc.light) Color(0xBAECECEC) else Color(0xFF5A5A5A)+private val ModeText get() = if (Pc.light) Color(0xFF6A6A6A) else Color(0xFFC5C5C5)+private val HsbPanelFill get() = if (Pc.light) Color(0xF7F1F1F1) else Color(0xF71E1E1E)+private val HsbLabel get() = if (Pc.light) Color(0xFF595959) else Color(0xFF808080)+private val HsbValue get() = if (Pc.light) Color(0xFF363636) else Color(0xFFEDEDED)/** The adjustments menu hanging from its button, in groups: colour, blurs, effects, painting. */@Composable@@ -217,8 +218,8 @@ private fun HsbRow(label: String, value: Float, track: Brush, knobColor: (Float)}}-private val PanelButton = Color(0xFF303030)-private val PanelButtonText = Color(0xFFA6A6A6)+private val PanelButton get() = if (Pc.light) Color(0xFFF8F8F8) else Color(0xFF303030)+private val PanelButtonText get() = if (Pc.light) Color(0xFF515151) else Color(0xFFA6A6A6)private val GridLine = Color(0xFF8A8A8A)private val BALANCE_PAIRS = listOf(@@ -359,7 +360,7 @@ fun CurvesPanel(vm: CanvasViewModel, modifier: Modifier = Modifier) {}val curve = vm.curveShape(vm.curveChannel)for (i in 1 until curve.size) {- drawLine(Color.White, Offset(curve[i - 1].x * w, (1f - curve[i - 1].y) * h), Offset(curve[i].x * w, (1f - curve[i].y) * h), 1.5.dp.toPx())+ drawLine(CurveInk, Offset(curve[i - 1].x * w, (1f - curve[i - 1].y) * h), Offset(curve[i].x * w, (1f - curve[i].y) * h), 1.5.dp.toPx())}for (p in points) node(Offset(p.x * w, (1f - p.y) * h), CurveNode, 1f)},@@ -397,8 +398,10 @@ fun CurvesPanel(vm: CanvasViewModel, modifier: Modifier = Modifier) {}private val CurveNode = Color(0xFF0171EA)+/** The curve: white, or black with the light interface. */+private val CurveInk get() = if (Pc.light) Color.Black else Color.White/** The Delete pill over a tapped point. */-private val CurveMenuFill = Color(0xFF262626)+private val CurveMenuFill get() = if (Pc.light) Color(0xFFF0F0F0) else Color(0xFF262626)/*** The gradient map panel: the gradient library (a tap chooses one, a tap on the chosen one edits@@ -564,7 +567,6 @@ private fun GradientEditor(vm: CanvasViewModel, index: Int) {// room round it for its shadow to fade out inval room = with(density) { PopupShadowRoom.toPx() }PcPopup(- textScale = MATCHED_POPUP_TEXT,popupPositionProvider = object : androidx.compose.ui.window.PopupPositionProvider {override fun calculatePosition(anchorBounds: androidx.compose.ui.unit.IntRect,@@ -598,15 +600,15 @@ private fun GradientEditor(vm: CanvasViewModel, index: Int) {}}-private val GradientBand = Color(0xFF535353)+private val GradientBand get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF535353)private val GradientDone = Color(0xFF0190FF)-private val PlusDisc = Color(0xFF1B1B1B)-private val PlusRim = Color(0xFF373737)-private val PlusGlyph = Color(0xFFAAAAAA)-private val EditorCard = Color(0xFF383838)-private val EditorName = Color(0xFFC5C5C5)-private val GradientCard = Color(0xFF282828)-private val GradientName = Color(0xFFC1C1C1)+private val PlusDisc get() = if (Pc.light) Color(0xFFFBFBFB) else Color(0xFF1B1B1B)+private val PlusRim get() = if (Pc.light) Color(0xFFE1E1E1) else Color(0xFF373737)+private val PlusGlyph get() = if (Pc.light) Color(0xFF595959) else Color(0xFFAAAAAA)+private val EditorCard get() = if (Pc.light) Color(0xFFEEEEEE) else Color(0xFF383838)+private val EditorName get() = if (Pc.light) Color(0xFF3A3A3A) else Color(0xFFC5C5C5)+private val GradientCard get() = if (Pc.light) Color(0xFFEEEEEE) else Color(0xFF282828)+private val GradientName get() = if (Pc.light) Color(0xFF5D5D5D) else Color(0xFFC1C1C1)/** A gradient to map by: its name and colour stops (position, 0xAARRGGBB), in any order. */data class GradientPreset(val name: String, val stops: List<Pair<Float, Long>>)@@ -637,8 +639,8 @@ val GRADIENTS = listOf(GradientPreset("Lagoon", listOf(0f to 0xFF06202A, 0.55f to 0xFF1B9A8E, 1f to 0xFFF4F1D0)),)-private val MenuButton = Color(0xFF3B3B3B)-private val MenuButtonText = Color(0xFFD8D8D8)+private val MenuButton get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF3B3B3B)+private val MenuButtonText get() = if (Pc.light) Color(0xFF414141) else Color(0xFFD8D8D8)/*** The menu a tap on the canvas opens during an adjustment: apply above, undo to the left, preview@@ -739,9 +741,9 @@ private val LiquifyIcons = mapOf(LiquifyKind.EDGE to { PcIcons.LiquifyEdge },LiquifyKind.RECONSTRUCT to { PcIcons.LiquifyReconstruct },)-private val LiquifyIdle = Color(0xFFAAAAAA)-private val LiquifyLabel = Color(0xFFA3A3A3)-private val LiquifyDim = Color(0xFF575757)+private val LiquifyIdle get() = if (Pc.light) Color(0xFF414141) else Color(0xFFAAAAAA)+private val LiquifyLabel get() = if (Pc.light) Color(0xFF414141) else Color(0xFFA3A3A3)+private val LiquifyDim get() = if (Pc.light) Color(0xFF989898) else Color(0xFF575757)/*** Liquify on a wide screen (1093 x 162): its ways, Adjust and Reset as a row of icon buttons (75@@ -836,7 +838,7 @@ private fun LiquifyUpright(vm: CanvasViewModel, modifier: Modifier) {}}-private val ModesFill = Color(0xFF7B7B7B)+private val ModesFill get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF7B7B7B)/** The Layer / Pencil choice under the mode bar: the adjustment changes the layer, or is painted on. */@Composable@@ -875,10 +877,10 @@ fun ClonePuck(vm: CanvasViewModel) {}}-private val KindsFill = Color(0xFF535353)-private val KindsEdge = Color(0xFF747474)-private val GlitchTrack = Color(0xFF2E2E2E)-private val GlitchTick = Color(0xFF4A4A4A)+private val KindsFill get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF535353)+private val KindsEdge get() = if (Pc.light) Color(0xFFFAFAFA) else Color(0xFF747474)+private val GlitchTrack get() = if (Pc.light) Color(0xFFDDDDDD) else Color(0xFF2E2E2E)+private val GlitchTick get() = if (Pc.light) Color(0xFFC8C8C8) else Color(0xFF4A4A4A)private val GLITCH_KINDS = listOf(Triple(GlitchKind.ARTIFACT, "Artifact", 111.dp),@@ -1025,8 +1027,8 @@ internal fun OptionSlider(label: String, value: Float, shown: String, width: Dp,}}-private val ModesText = Color(0xFFD0D0D0)-private val ValueChip = Color(0xFF2A2A2A)+private val ModesText get() = if (Pc.light) Color(0xFF3B3B3B) else Color(0xFFD0D0D0)+private val ValueChip get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF2A2A2A)private fun GlitchKind.icon() = when (this) {GlitchKind.ARTIFACT -> PcIcons.GlitchArtifact@@ -1099,7 +1101,7 @@ fun NoisePanel(vm: CanvasViewModel, modifier: Modifier = Modifier) {}}-private val NoiseButton = Color(0xFF1E1E1E)+private val NoiseButton get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF1E1E1E)/** The bloom toolbar: transition, size and burn. */@Composable@@ -1124,12 +1126,12 @@ fun BloomPanel(vm: CanvasViewModel, modifier: Modifier = Modifier) {}}-private val MoreFill = Color(0xFF1C1C1C)-private val MoreEdge = Color(0xFF3A3A3A)-private val MoreDots = Color(0xFF9A9A9A)-private val OptionsMenuFill = Color(0xF2262626)-private val OptionsGroupFill = Color(0xFF1B1B1B)-private val OptionsLine = Color(0xFF2E2E2E)+private val MoreFill get() = if (Pc.light) Color(0xFFFAFAFA) else Color(0xFF1C1C1C)+private val MoreEdge get() = if (Pc.light) Color(0xFFE1E1E1) else Color(0xFF3A3A3A)+private val MoreDots get() = if (Pc.light) Color(0xFF595959) else Color(0xFF9A9A9A)+private val OptionsMenuFill get() = if (Pc.light) Color(0xF2F0F0F0) else Color(0xF2262626)+private val OptionsGroupFill get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF1B1B1B)+private val OptionsLine get() = if (Pc.light) Color(0xFFE2E2E2) else Color(0xFF2E2E2E)/*** A toolbar's "•••" button (41 × 40, 3 lower than the sliders' top): it opens a small menu overdiff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/AnimatedExportUi.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/AnimatedExportUi.ktindex 7d978d7..aca059a 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/AnimatedExportUi.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/AnimatedExportUi.kt@@ -57,14 +57,14 @@ import kotlinx.coroutines.launchimport kotlinx.coroutines.withContextimport kotlin.math.roundToInt-private val ScreenFill = Color(0xFF1F1F1F)-private val TitleInk = Color(0xFFAAAAAA)-private val RowInk = Color(0xFFC1C1C1)-private val PanelFill = Color(0xFF262626)-private val PanelEdge = Color(0xFF363636)-private val SegmentTrack = Color(0xFF3C3C3C)-private val CapsuleFill = Color(0xFF1A1A1A)-private val CapsuleEdge = Color(0xFF373737)+private val ScreenFill get() = if (Pc.light) Color(0xFFF2F2F2) else Color(0xFF1F1F1F)+private val TitleInk get() = if (Pc.light) Color(0xFF3D3D3D) else Color(0xFFAAAAAA)+private val RowInk get() = if (Pc.light) Color(0xFF595959) else Color(0xFFC1C1C1)+private val PanelFill get() = if (Pc.light) Color(0xFFEBEBEB) else Color(0xFF262626)+private val PanelEdge get() = if (Pc.light) Color(0xFFDADADA) else Color(0xFF363636)+private val SegmentTrack get() = if (Pc.light) Color(0xFFD5D5D5) else Color(0xFF3C3C3C)+private val CapsuleFill get() = if (Pc.light) Color(0xFFFBFBFB) else Color(0xFF1A1A1A)+private val CapsuleEdge get() = if (Pc.light) Color(0xFFE0E0E0) else Color(0xFF373737)private val DoneBlue = Color(0xFF0190FF)/**@@ -212,7 +212,7 @@ private fun ExportScreen(}private val PanelWidth = 400.dp-private val SizeInk = Color(0xFF8E8E8E)+private val SizeInk get() = if (Pc.light) Color(0xFF3F3F3F) else Color(0xFF8E8E8E)/*** Sharing a model on a turntable: it turning as it will, the settings (the size, once round or@@ -307,8 +307,8 @@ private fun SettingRow(label: String, on: Boolean, onChange: (Boolean) -> Unit)}}-private val ChoiceFill = Color(0xFF2E2E2E)-private val SliderTrack = Color(0xFF3E3E3E)+private val ChoiceFill get() = if (Pc.light) Color(0xFFE3E3E3) else Color(0xFF2E2E2E)+private val SliderTrack get() = if (Pc.light) Color(0xFFDDDDDD) else Color(0xFF3E3E3E)/** One of two choices in a group, 40 tall: the chosen one blue with a tick. */diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/BrushLibrary.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/BrushLibrary.ktindex 68667d1..3bdfca9 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/BrushLibrary.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/BrushLibrary.kt@@ -68,6 +68,7 @@ import androidx.compose.ui.layout.ContentScaleimport androidx.compose.ui.layout.layoutimport androidx.compose.ui.layout.boundsInWindowimport androidx.compose.ui.layout.onGloballyPositioned+import androidx.compose.ui.layout.positionOnScreenimport androidx.compose.ui.layout.onSizeChangedimport androidx.compose.ui.platform.LocalContextimport androidx.compose.ui.platform.LocalDensity@@ -233,8 +234,10 @@ fun BrushLibrary(vm: CanvasViewModel, arrowX: Dp, modifier: Modifier = Modifier)val density = LocalDensity.currentvar adding by remember { mutableStateOf(false) }var setMenu by remember { mutableStateOf<Int?>(null) }- // the set menu's icon grid is open+ // the set menu's icon grid is open; where its Customize icon row and the set are on screenvar iconPicker by remember { mutableStateOf(false) }+ var customizeRow by remember { mutableStateOf<Pair<Float, Float>?>(null) }+ var setScreenTop by remember { mutableStateOf(0f) }// the search: what is typed, and whether the field is in usevar query by remember { mutableStateOf("") }var searching by remember { mutableStateOf(false) }@@ -346,7 +349,10 @@ fun BrushLibrary(vm: CanvasViewModel, arrowX: Dp, modifier: Modifier = Modifier)val selected = i == vm.shownSetBox {Row(- Modifier.fillMaxWidth().height(50.dp).onGloballyPositioned { setBounds[i] = it.boundsInWindow() }.clip(RoundedCornerShape(12.dp))+ Modifier.fillMaxWidth().height(50.dp).onGloballyPositioned {+ setBounds[i] = it.boundsInWindow()+ if (selected) setScreenTop = it.positionOnScreen().y+ }.clip(RoundedCornerShape(12.dp)).background(if (overSet == i) Pc.Accent else if (selected) Pc.RowSelected else Pc.SetCell).clickable { if (selected) setMenu = i else vm.showSet(i) },verticalAlignment = Alignment.CenterVertically,@@ -373,22 +379,35 @@ fun BrushLibrary(vm: CanvasViewModel, arrowX: Dp, modifier: Modifier = Modifier)// centred on the set, a little left of itval left = with(density) { 6.dp.roundToPx() }val below = with(density) { MenuTop.roundToPx() }- // the icons to choose from, beside the menu on its left- MenuPresence(setMenu == i && iconPicker, androidx.compose.ui.graphics.TransformOrigin(1f, 0.5f)) { look ->+ // the icons to choose from, right of the menu over the library: under the Customize icon+ // row, or over it when there is no room below; scrolled to the set's own icon+ MenuPresence(setMenu == i && iconPicker, androidx.compose.ui.graphics.TransformOrigin(0f, 0f)) { look ->PcPopup(- textScale = MATCHED_POPUP_TEXT,- popupPositionProvider = MenuPlace(below) { a, size -> IntOffset(a.left - left - size.width + with(density) { 6.dp.roundToPx() }, a.center.y - size.height / 2 + with(density) { 40.dp.roundToPx() }) },+ popupPositionProvider = remember(customizeRow, setScreenTop, density) {+ MenuPlace(below) { a, size ->+ val x = a.left - with(density) { PickerInset.roundToPx() }+ val row = customizeRow ?: return@MenuPlace IntOffset(x, a.top)+ val top = a.top + (row.first - setScreenTop).roundToInt()+ val bottom = a.top + (row.second - setScreenTop).roundToInt()+ val room = (vm.windowSize.y - with(density) { PickerMargin.toPx() }).roundToInt()+ IntOffset(x, if (bottom + size.height <= room) bottom else top - size.height)+ }+ },onDismissRequest = { iconPicker = false },) {- val shape = RoundedCornerShape(16.dp)+ val shape = RoundedCornerShape(26.dp)+ // an icon that isn't one of the picker's starts it at the top+ val own = set.icon.toInt().takeIf { it in 0 until PcIcons.PICKED_SET_ICONS }+ val first = if (own == null) 0 else (own / PICKER_COLUMNS - 3).coerceAtLeast(0) * PICKER_COLUMNSLazyVerticalGrid(- columns = GridCells.Fixed(5),- modifier = look.size(252.dp, 327.dp).clip(shape).background(MenuFill).border(1.dp, MenuEdge, shape).padding(4.dp),+ columns = GridCells.Fixed(PICKER_COLUMNS),+ state = androidx.compose.foundation.lazy.grid.rememberLazyGridState(initialFirstVisibleItemIndex = first),+ modifier = look.size(250.dp, 325.dp).clip(shape).background(MenuFill).border(1.dp, MenuEdge, shape).padding(3.dp),) {items(PcIcons.PICKED_SET_ICONS) { k ->val chosen = k == set.icon.toInt()Box(- Modifier.size(48.dp).clip(CircleShape).background(if (chosen) Pc.Accent else Color.Transparent).clickable {+ Modifier.size(48.dp).clip(RoundedCornerShape(21.dp)).background(if (chosen) Pc.Accent else Color.Transparent).clickable {vm.changeBrushSetIcon(i, k)iconPicker = falsesetMenu = null@@ -411,8 +430,10 @@ fun BrushLibrary(vm: CanvasViewModel, arrowX: Dp, modifier: Modifier = Modifier)setMenu = nullvm.duplicateBrushSet(i)}- MenuItem(PcIcons.SetIcons.getOrElse(set.icon.toInt()) { PcIcons.BrushSet }, "Customize icon", trailing = PcIcons.MenuChevron) {- iconPicker = !iconPicker+ Box(Modifier.onGloballyPositioned { c -> c.positionOnScreen().y.let { customizeRow = it to it + c.size.height } }) {+ MenuItem(PcIcons.SetIcons.getOrElse(set.icon.toInt()) { PcIcons.BrushSet }, "Customize icon", trailing = PcIcons.MenuChevron) {+ iconPicker = !iconPicker+ }}MenuDivider()MenuItem(PcIcons.MenuShare, "Share") {@@ -623,7 +644,7 @@ internal fun LibraryMenu(/** A menu row: its icon (a 40 frame) centred 29.5 in, the label from 52, a chevron 27.5 from the right. */@Composable-internal fun MenuItem(icon: ImageVector, label: String, ink: Color = Color.White, trailing: ImageVector? = null, iconSize: Dp = 40.dp, onClick: () -> Unit) {+internal fun MenuItem(icon: ImageVector, label: String, ink: Color = Pc.MenuInk, trailing: ImageVector? = null, iconSize: Dp = 40.dp, onClick: () -> Unit) {Row(Modifier.fillMaxWidth().height(40.dp).clickable(onClick = onClick), verticalAlignment = Alignment.CenterVertically) {Box(Modifier.padding(start = 9.5.dp).size(40.dp), contentAlignment = Alignment.Center) {Icon(icon, contentDescription = null, tint = ink, modifier = Modifier.requiredSize(iconSize))@@ -640,6 +661,11 @@ internal fun MenuDivider(gap: Dp = 10.dp) {}/** Places a menu from its anchor's bounds and its own size, kept in the window below [top]. */+/** The set icon picker: its columns, how far left of the set it starts, and the room it keeps below. */+private const val PICKER_COLUMNS = 5+private val PickerInset = 11.dp+private val PickerMargin = 25.dp+internal class MenuPlace(private val top: Int = 0, private val place: (IntRect, IntSize) -> IntOffset) : PopupPositionProvider {override fun calculatePosition(anchorBounds: IntRect, windowSize: IntSize, layoutDirection: LayoutDirection, popupContentSize: IntSize): IntOffset {val p = place(anchorBounds, popupContentSize)diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/BrushStudio.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/BrushStudio.ktindex c651990..4515958 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/BrushStudio.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/BrushStudio.kt@@ -77,43 +77,43 @@ import androidx.compose.ui.layout.onSizeChangedimport androidx.compose.foundation.lazy.rememberLazyListStateimport androidx.compose.ui.platform.LocalDensity-private val StudioTabs = Color(0xFF272727)-private val StudioBack = Color(0xFF1F1F1F)-private val StudioLine = Color(0xFF303030)-private val StudioHeader = Color(0xFF9C9C9C)-private val StudioLabel = Color(0xFFEDEDED)-private val StudioDim = Color(0xFF8E8E8E)+private val StudioTabs get() = if (Pc.light) Color(0xFFEBEBEB) else Color(0xFF272727)+private val StudioBack get() = if (Pc.light) Color(0xFFF3F3F3) else Color(0xFF1F1F1F)+private val StudioLine get() = if (Pc.light) Color(0xFFCFCFCF) else Color(0xFF303030)+private val StudioHeader get() = if (Pc.light) Color(0xFF818181) else Color(0xFF9C9C9C)+private val StudioLabel get() = if (Pc.light) Color(0xFF343434) else Color(0xFFEDEDED)+private val StudioDim get() = if (Pc.light) Color(0xFF9A9A9A) else Color(0xFF8E8E8E)// a control that can't be used now-private val StudioOff = Color(0xFF505050)+private val StudioOff get() = if (Pc.light) Color(0xFFD5D5D5) else Color(0xFF505050)/** Landscape: the pages' card's edge and title, the pages' names, and the settings column's width. */-private val StudioCardEdge = Color(0xFF373737)-private val StudioCardTitle = Color(0xFFC1C1C1)-private val StudioPageInk = Color(0xFF797979)+private val StudioCardEdge get() = if (Pc.light) Color(0xFFDADADA) else Color(0xFF373737)+private val StudioCardTitle get() = if (Pc.light) Color(0xFF4A4A4A) else Color(0xFFC1C1C1)+private val StudioPageInk get() = if (Pc.light) Color(0xFF3E3E3E) else Color(0xFF797979)private val SettingsWidth = 323.dp/** A switch that can't be changed here: the usual one, faded. */private val StudioSwitchFixed = Color(0xFF515153)private val StudioSwitchFixedKnob = Color(0xFF9B9B9B)/** A slider that can't be changed here: its value and knob faded into the panel. */-private val StudioPillOff = Color(0xFF222222)-private val StudioValueOff = Color(0xFF646464)-private val StudioKnobOff = Color(0xFF353535)-private val StudioList = Color(0xFF242424)-private val StudioListLine = Color(0xFF202020)-private val StudioSegments = Color(0xFF3C3C3C)-private val StudioMaterial = Color(0xFF232323)-private val StudioMaterialInk = Color(0xFFB1B1B1)-private val StudioPill = Color(0xFF292929)-private val StudioTrack = Color(0xFF333333)-private val StudioTabIcon = Color(0xFFAAAAAA)-private val StudioButton = Color(0xFF1C1C1C)-private val StudioButtonEdge = Color(0xFF383838)+private val StudioPillOff get() = if (Pc.light) Color(0xFFEDEDED) else Color(0xFF222222)+private val StudioValueOff get() = if (Pc.light) Color(0xFFA0A0A0) else Color(0xFF646464)+private val StudioKnobOff get() = if (Pc.light) Color(0xFFD0D0D0) else Color(0xFF353535)+private val StudioList get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF242424)+private val StudioListLine get() = if (Pc.light) Color(0xFFE5E5E5) else Color(0xFF202020)+private val StudioSegments get() = if (Pc.light) Color(0xFFDCDCDC) else Color(0xFF3C3C3C)+private val StudioMaterial get() = if (Pc.light) Color(0xFFECECEC) else Color(0xFF232323)+private val StudioMaterialInk get() = if (Pc.light) Color(0xFF4A4A4A) else Color(0xFFB1B1B1)+private val StudioPill get() = if (Pc.light) Color(0xFFE5E5E5) else Color(0xFF292929)+private val StudioTrack get() = if (Pc.light) Color(0xFFE5E5E5) else Color(0xFF333333)+private val StudioTabIcon get() = if (Pc.light) Color(0xFF3D3D3D) else Color(0xFFAAAAAA)+private val StudioButton get() = if (Pc.light) Color(0xFFFBFBFB) else Color(0xFF1C1C1C)+private val StudioButtonEdge get() = if (Pc.light) Color(0xFFE0E0E0) else Color(0xFF383838)// the pad's buttons' text and icon: grey, not the labels' white-private val StudioButtonInk = Color(0xFFAAAAAA)-private val StudioGroup = Color(0xFF262626)-private val StudioCard = Color(0xFF313131)-private val PreviewCardFill = Color(0xFF2A2A2A)-private val PreviewCardEdge = Color(0xFF4A4A4A)-private val PreviewCardName = Color(0xFFC5C5C5)+private val StudioButtonInk get() = if (Pc.light) Color(0xFF585858) else Color(0xFFAAAAAA)+private val StudioGroup get() = if (Pc.light) Color(0xFFEBEBEB) else Color(0xFF262626)+private val StudioCard get() = if (Pc.light) Color(0xFFE5E5E5) else Color(0xFF313131)+private val PreviewCardFill get() = if (Pc.light) Color(0xFFE8E8E8) else Color(0xFF2A2A2A)+private val PreviewCardEdge get() = if (Pc.light) Color(0xFFD0D0D0) else Color(0xFF4A4A4A)+private val PreviewCardName get() = if (Pc.light) Color(0xFF3A3A3A) else Color(0xFFC5C5C5)private val StudioDone = Color(0xFF0190FF)/** Where the settings start below the drawing pad (points from the top). */@@ -491,7 +491,7 @@ private fun shownValue(v: Float, shown: Shown, most: Float = 16f): String {}}-private val PadBehind = Color(0xFF1F1F1F)+private val PadBehind get() = if (Pc.light) Color(0xFFF3F3F3) else Color(0xFF1F1F1F)/*** The brush studio: tabs down the left, the drawing pad above, the tab's settings below. It slides up@@ -859,11 +859,11 @@ private fun SourceBox(vm: CanvasViewModel, c: StudioControl.Source) {}}-private val AboutCard = Color(0xFF252525)-private val AboutFace = Color(0xFF3A3A3A)-private val AboutName = Color(0xFFE0E0E0)-private val AboutRowInk = Color(0xFFBBBBBB)-private val AboutSignature = Color(0xFF595959)+private val AboutCard get() = if (Pc.light) Color(0xFFEBEBEB) else Color(0xFF252525)+private val AboutFace get() = if (Pc.light) Color(0xFFD8D8D8) else Color(0xFF3A3A3A)+private val AboutName get() = if (Pc.light) Color(0xFF2A2A2A) else Color(0xFFE0E0E0)+private val AboutRowInk get() = if (Pc.light) Color(0xFF4A4A4A) else Color(0xFFBBBBBB)+private val AboutSignature get() = if (Pc.light) Color(0xFFA8A8A8) else Color(0xFF595959)private val PadMenuFill = Color(0xFFC1C1C1)private val PadMenuGroup = Color(0xFFD3D3D3)@@ -1351,12 +1351,12 @@ private fun TaperBar(start: Float, end: Float, onStart: (Float) -> Unit, onEnd:/** How far in from the row's ends the taper handles stop: where the sliders' knobs do. */private val TAPER_TRAVEL = 15.dp-private val TaperBox = Color(0xFF212121)+private val TaperBox get() = if (Pc.light) Color(0xFFEBEBEB) else Color(0xFF212121)/** The studio's pressure curve: a darker box with a light edge, a grey curve, small handles. */-private val StudioCurveFill = Color(0xFF1B1B1B)-private val StudioCurveEdge = Color(0xFF353535)-private val StudioCurveLine = Color(0xFFD5D5D5)-private val TaperBarFill = Color(0xFF363636)+private val StudioCurveFill get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF1B1B1B)+private val StudioCurveEdge get() = if (Pc.light) Color(0xFFD8D8D8) else Color(0xFF353535)+private val StudioCurveLine get() = if (Pc.light) Color(0xFF3A3A3A) else Color(0xFFD5D5D5)+private val TaperBarFill get() = if (Pc.light) Color(0xFFDCDCDC) else Color(0xFF363636)/*** How the tilt angle's graph is coloured: its box, the quarter disc, the arc, the line, the angle's@@ -1487,11 +1487,11 @@ internal fun RoundnessGraph(roundness: Float, angle: Float, onRoundness: (Float)}private val RoundnessGreen = Color(0xFF42E347)-private val RoundnessCross = Color(0xFF4C4C4C)-private val RoundnessFill = Color(0xD6232323)-private val RoundnessEdge = Color(0xFF565656)-private val TiltBox = Color(0xFF1B1B1B)-private val TiltLabel = Color(0xFF8E8E8E)+private val RoundnessCross get() = if (Pc.light) Color(0xFFC0C0C0) else Color(0xFF4C4C4C)+private val RoundnessFill get() = if (Pc.light) Color(0xD6F0F0F0) else Color(0xD6232323)+private val RoundnessEdge get() = if (Pc.light) Color(0xFFC8C8C8) else Color(0xFF565656)+private val TiltBox get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF1B1B1B)+private val TiltLabel get() = if (Pc.light) Color(0xFF808080) else Color(0xFF8E8E8E)@Composableinternal fun PressureCurve(diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/CanvasInfoUi.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/CanvasInfoUi.ktindex b284f08..d44dca7 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/CanvasInfoUi.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/CanvasInfoUi.kt@@ -72,25 +72,28 @@ import java.util.Dateimport kotlin.math.roundToIntimport kotlinx.coroutines.launch-private val ScreenFill = Color(0xFF1F1F1F)-private val RailFill = Color(0xFF272727)-private val CardFill = Color(0xFF252525)-private val Ink = Color(0xFFC1C1C1)-private val RailIdle = Color(0xFFAAAAAA)-private val PhotoFill = Color(0xFF303030)-private val PhotoGlyph = Color(0xFF4E4E4E)-private val Placeholder = Color(0xFF605F63)-private val SignLine = Color(0xFF494949)-private val CapsuleFill = Color(0xFF1A1A1A)-private val CapsuleEdge = Color(0xFF373737)+private val ScreenFill get() = if (Pc.light) Color(0xFFF3F3F3) else Color(0xFF1F1F1F)+private val RailFill get() = if (Pc.light) Color(0xFFEBEBEB) else Color(0xFF272727)+private val CardFill get() = if (Pc.light) Color(0xFFEBEBEB) else Color(0xFF252525)+private val Ink get() = if (Pc.light) Color(0xFF3B3B3B) else Color(0xFFC1C1C1)+private val RailIdle get() = if (Pc.light) Color(0xFF3D3D3D) else Color(0xFFAAAAAA)+private val PhotoFill get() = if (Pc.light) Color(0xFFB3B3B3) else Color(0xFF303030)+private val PhotoGlyph get() = if (Pc.light) Color(0xFFF5F5F5) else Color(0xFF4E4E4E)+private val Placeholder get() = if (Pc.light) Color(0xFFB8B8BC) else Color(0xFF605F63)+private val SignLine get() = if (Pc.light) Color(0xFF9A9A9A) else Color(0xFF494949)+private val CapsuleFill get() = if (Pc.light) Color(0xFFFBFBFB) else Color(0xFF1A1A1A)+private val CapsuleEdge get() = if (Pc.light) Color(0xFFE0E0E0) else Color(0xFF373737)private val DoneBlue = Color(0xFF0190FF)private val CardCorner = 25.dp/** Where a wide screen's page starts and ends, beside the pages' card. */private val WideContentStart = 358.dpprivate val WideContentEnd = 28.dp-private val CardEdge = Color(0xFF373737)-private val PageInk = Color(0xFF797979)+private val CardEdge get() = if (Pc.light) Color(0xFFDADADA) else Color(0xFF373737)+private val PageInk get() = if (Pc.light) Color(0xFF3E3E3E) else Color(0xFF797979)+// "Sign here" and its clear button: the photo's glyph in dark, darker greys on light+private val SignInk get() = if (Pc.light) Color(0xFF666666) else PhotoGlyph+private val SignClear get() = if (Pc.light) Color(0xFF393939) else PhotoGlyph/** The pages by icon and name on a card headed "Canvas Info" (a wide screen's), as the brush studio's. */@Composable@@ -311,7 +314,7 @@ fun CanvasInfo(vm: CanvasViewModel) {@Composableprivate fun CapsuleText(label: String, onClick: () -> Unit) {Box(Modifier.fillMaxHeight().clickable(onClick = onClick).padding(horizontal = 13.dp), contentAlignment = Alignment.Center) {- Text(label, color = Color(0xFFA5A5A5), fontSize = 17.sp)+ Text(label, color = if (Pc.light) Color(0xFF585858) else Color(0xFFA5A5A5), fontSize = 17.sp)}}@@ -400,9 +403,9 @@ private fun AboutCard(photo: ImageBitmap?, author: String, onAuthor: (String) ->drawPath(path, Ink, style = Stroke(2.dp.toPx(), cap = StrokeCap.Round, join = StrokeJoin.Round))}}- Text("Sign here", color = PhotoGlyph, fontSize = 11.sp, modifier = Modifier.offset(x = 50.dp, y = 90.dp))+ Text("Sign here", color = SignInk, fontSize = 11.sp, modifier = Modifier.offset(x = 50.dp, y = 90.dp))// always there, at the line's end- Box(Modifier.offset(x = 330.dp, y = 58.dp).size(22.dp).clip(CircleShape).background(PhotoGlyph).clickable { signature.clear() }, contentAlignment = Alignment.Center) {+ Box(Modifier.offset(x = 330.dp, y = 58.dp).size(22.dp).clip(CircleShape).background(SignClear).clickable { signature.clear() }, contentAlignment = Alignment.Center) {Icon(PcIcons.Cross, contentDescription = "Clear the signature", tint = CardFill, modifier = Modifier.size(14.dp))}}diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ColorPanel.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ColorPanel.ktindex ceaa8b9..5c62ceb 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ColorPanel.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ColorPanel.kt@@ -276,7 +276,8 @@ private val CompactHexField = Color(0xFF343434)fun CompactColors(vm: CanvasViewModel, c: ColorPick, arrowX: Dp, modifier: Modifier = Modifier, side: ArrowSide = ArrowSide.TOP) {var mode by remember { mutableStateOf(ColorMode.DISC) }Popover(CompactWidth, arrowX, modifier, fill = CompactFill, side = side) {- Text("Colors", color = Pc.PanelTitle, fontSize = 24.sp, fontWeight = FontWeight.Bold, modifier = Modifier.padding(start = 18.dp, top = 9.dp, bottom = 5.dp))+ // a 16.5 cap, as measured over a gradient stop+ Text("Colors", color = Pc.PanelTitle, fontSize = 23.sp, fontWeight = FontWeight.Bold, modifier = Modifier.padding(start = 18.dp, top = 9.dp, bottom = 5.dp))CompactBody(vm, c, mode)CompactTabs(mode) { mode = it }}@@ -587,8 +588,8 @@ private fun HarmonyKindButton(vm: CanvasViewModel) {}.padding(start = 20.dp, end = 18.dp),verticalAlignment = Alignment.CenterVertically,) {- Text(kind.label, color = Color.White, fontSize = 17.sp, maxLines = 1, modifier = Modifier.weight(1f))- if (kind == vm.harmonyKind) Icon(PcIcons.Tick, contentDescription = null, tint = Color.White, modifier = Modifier.size(18.dp))+ Text(kind.label, color = Pc.MenuInk, fontSize = 17.sp, maxLines = 1, modifier = Modifier.weight(1f))+ if (kind == vm.harmonyKind) Icon(PcIcons.Tick, contentDescription = null, tint = Pc.MenuInk, modifier = Modifier.size(18.dp))}}}@@ -1232,7 +1233,7 @@ private fun ShortBottomMenu(vm: CanvasViewModel, history: Boolean, modifier: Mod}.padding(start = 20.dp, end = 19.dp),verticalAlignment = Alignment.CenterVertically,) {- Text(label, color = Color.White, fontSize = 18.sp, maxLines = 1, modifier = Modifier.weight(1f))+ Text(label, color = Pc.MenuInk, fontSize = 18.sp, maxLines = 1, modifier = Modifier.weight(1f))Radio(on == history)}}@@ -1298,7 +1299,8 @@ private fun ModeTab(icon: ImageVector, label: String, selected: Boolean, modifie)Text(label,- color = if (selected) Color.White else Pc.PanelTitle,+ // the chosen one white, or black with the light interface+ color = if (!selected) Pc.PanelTitle else if (Pc.light) Color.Black else Color.White,fontSize = 13.sp,fontWeight = FontWeight.Medium,maxLines = 1,diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/CropUi.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/CropUi.ktindex 552bd63..c861f95 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/CropUi.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/CropUi.kt@@ -57,13 +57,16 @@ import kotlin.math.cosimport kotlin.math.roundToIntimport kotlin.math.sin-private val FrameLine = Color(0xCCFFFFFF)-private val GridLine = Color(0x66C8C8C8)-private val Mark = Color(0xFFD0D0D0)-private val PopoverFill = Color(0xF21F1F1F)-private val FieldFill = Color(0xFF242424)-private val GroupFill = Color(0xFF2A2A2A)-private val RowLine = Color(0xFF3A3A3A)+// light over the dark surround; dark with the light interface+private val FrameLine get() = if (Pc.light) Color(0xCC303030) else Color(0xCCFFFFFF)+private val GridLine get() = if (Pc.light) Color(0x99606060) else Color(0x66C8C8C8)+private val Mark get() = if (Pc.light) Color(0xFF3A3A3A) else Color(0xFFD0D0D0)+// Settings: dark, or with the light interface #dbdedf behind #e4e4e6 groups, #d3d3d5 fields, dark words+private val PopoverFill get() = if (Pc.light) Color(0xF2DBDEDF) else Color(0xF21F1F1F)+private val FieldFill get() = if (Pc.light) Color(0xFFD3D3D5) else Color(0xFF242424)+private val GroupFill get() = if (Pc.light) Color(0xFFE4E4E6) else Color(0xFF2A2A2A)+private val RowLine get() = if (Pc.light) Color(0xFFD6D6D8) else Color(0xFF3A3A3A)+private val SettingsInk get() = if (Pc.light) Color(0xFF3B3B3B) else Color(0xFFD2D2D2)private val Muted = Color(0xFF8E8E93)/** Which part of the crop's frame a drag takes. */@@ -210,19 +213,19 @@ private fun CropSettings(vm: CanvasViewModel, modifier: Modifier) {Popover(348.dp, 174.5.dp, modifier, fill = PopoverFill, corner = 24.dp) {Column(Modifier.padding(10.dp)) {Box(Modifier.height(40.dp), contentAlignment = Alignment.CenterStart) {- Text("Settings", color = Color(0xFFD2D2D2), fontSize = 22.sp, fontWeight = FontWeight.Bold, modifier = Modifier.padding(start = 14.dp))+ Text("Settings", color = SettingsInk, fontSize = 22.sp, fontWeight = FontWeight.Bold, modifier = Modifier.padding(start = 14.dp))}val (w, h) = vm.cropSizeRow(Modifier.padding(top = 10.dp).fillMaxWidth().height(44.dp).padding(horizontal = 2.dp), verticalAlignment = Alignment.CenterVertically) {NumberField(w.toString(), "px", Modifier.width(137.dp)) { it.toIntOrNull()?.let { v -> vm.changeCropSize(v, null) } }Box(Modifier.padding(horizontal = 8.dp).size(34.dp, 40.dp).clickable { vm.cropAspectLocked = !vm.cropAspectLocked }, contentAlignment = Alignment.Center) {- Icon(PcIcons.Link, contentDescription = "Aspect lock", tint = if (vm.cropAspectLocked) Pc.Accent else Color(0xFFD2D2D2), modifier = Modifier.size(20.dp))+ Icon(PcIcons.Link, contentDescription = "Aspect lock", tint = if (vm.cropAspectLocked) Pc.Accent else SettingsInk, modifier = Modifier.size(20.dp))}NumberField(h.toString(), "px", Modifier.width(137.dp)) { it.toIntOrNull()?.let { v -> vm.changeCropSize(null, v) } }}Column(Modifier.padding(top = 10.dp).fillMaxWidth().clip(RoundedCornerShape(14.dp)).background(GroupFill)) {Row(Modifier.fillMaxWidth().height(44.dp).padding(start = 12.dp, end = 4.dp), verticalAlignment = Alignment.CenterVertically) {- Text("DPI", color = Color(0xFFD2D2D2), fontSize = 17.sp, modifier = Modifier.weight(1f))+ Text("DPI", color = SettingsInk, fontSize = 17.sp, modifier = Modifier.weight(1f))NumberField("%.1f".format(vm.cropDpi), null, Modifier.width(80.dp).height(36.dp)) { it.toFloatOrNull()?.let(vm::changeCropDpi) }}Box(Modifier.fillMaxWidth().height(1.dp).background(RowLine))@@ -240,7 +243,7 @@ private fun CropSettings(vm: CanvasViewModel, modifier: Modifier) {@Composableprivate fun SwitchRow(label: String, on: Boolean, onChange: (Boolean) -> Unit) {Row(Modifier.fillMaxWidth().height(44.dp).clickable { onChange(!on) }.padding(start = 12.dp, end = 6.dp), verticalAlignment = Alignment.CenterVertically) {- Text(label, color = Color(0xFFD2D2D2), fontSize = 17.sp, modifier = Modifier.weight(1f))+ Text(label, color = SettingsInk, fontSize = 17.sp, modifier = Modifier.weight(1f))Switch(on, enabled = true)}}@@ -249,7 +252,7 @@ private fun SwitchRow(label: String, on: Boolean, onChange: (Boolean) -> Unit) {@Composableprivate fun NumberField(value: String, unit: String?, modifier: Modifier, onChange: (String) -> Unit) {var text by remember(value) { mutableStateOf(value) }- val style = TextStyle(color = Color(0xFFD2D2D2), fontSize = 17.sp, textAlign = TextAlign.Center)+ val style = TextStyle(color = SettingsInk, fontSize = 17.sp, textAlign = TextAlign.Center)// as wide as its text (and the cursor), so the number and unit sit together in the middleval measurer = rememberTextMeasurer()val textWidth = with(LocalDensity.current) { measurer.measure(text, style).size.width.toDp() } + 2.dp@@ -266,7 +269,7 @@ private fun NumberField(value: String, unit: String?, modifier: Modifier, onChankeyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Decimal),modifier = Modifier.width(textWidth),)- if (unit != null) Text(" $unit", color = Color(0xFFD2D2D2), fontSize = 17.sp)+ if (unit != null) Text(" $unit", color = SettingsInk, fontSize = 17.sp)}}@@ -277,8 +280,8 @@ private fun RotationSlider(radians: Float, onChange: (Float) -> Unit) {val degrees = Math.toDegrees(radians.toDouble()).toFloat()Column(Modifier.padding(horizontal = 10.dp, vertical = 8.dp)) {Row {- Text("Rotation", color = Color(0xFFD2D2D2), fontSize = 17.sp, modifier = Modifier.weight(1f))- Text("%.1f°".format(degrees), color = Color(0xFFD2D2D2), fontSize = 17.sp)+ Text("Rotation", color = SettingsInk, fontSize = 17.sp, modifier = Modifier.weight(1f))+ Text("%.1f°".format(degrees), color = SettingsInk, fontSize = 17.sp)}Box(Modifier.fillMaxWidth().height(22.dp).pointerInput(Unit) {@@ -296,7 +299,7 @@ private fun RotationSlider(radians: Float, onChange: (Float) -> Unit) {}.drawBehind {val y = size.height / 2fval h = 3.dp.toPx()- drawRoundRect(Color(0xFF555555), Offset(0f, y - h / 2f), Size(size.width, h), CornerRadius(h / 2f))+ drawRoundRect(if (Pc.light) Color(0xFFCFCFD1) else Color(0xFF555555), Offset(0f, y - h / 2f), Size(size.width, h), CornerRadius(h / 2f))drawLine(Muted, Offset(size.width / 2f, y - 6.dp.toPx()), Offset(size.width / 2f, y + 6.dp.toPx()), 1.dp.toPx())val knob = Size(26.dp.toPx(), 15.dp.toPx())val x = (((degrees + 180f) / 360f).coerceIn(0f, 1f) * size.width).coerceIn(knob.width / 2f, size.width - knob.width / 2f)diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/CustomCanvasUi.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/CustomCanvasUi.ktindex e74a387..cdbfd1d 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/CustomCanvasUi.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/CustomCanvasUi.kt@@ -50,19 +50,19 @@ import io.github.artcraftandroid.procraft.gallery.CanvasPresetimport kotlinx.coroutines.launchimport kotlin.math.roundToInt-private val ScreenFill = Color(0xFF1F1F1F)-private val PanelFill = Color(0xFF282828)-private val Ink = Color(0xFFAAAAAA)-private val IdleInk = Color(0xFF797979)+private val ScreenFill get() = if (Pc.light) Color(0xFFF2F2F2) else Color(0xFF1F1F1F)+private val PanelFill get() = if (Pc.light) Color(0xFFDFDFDF) else Color(0xFF282828)+private val Ink get() = if (Pc.light) Color(0xFF3E3E3E) else Color(0xFFAAAAAA)+private val IdleInk get() = if (Pc.light) Color(0xFF3E3E3E) else Color(0xFF797979)private val Editing = Color(0xFF436BF0)-private val KeypadFill = Color(0xFF1A1A1A)-private val DigitFill = Color(0xFF525252)-private val KeyFill = Color(0xFF2B2B2B)-private val UnitChosen = Color(0xFFA1A1A1)-private val SwitchTrack = Color(0xFF353535)-private val SwitchIdle = Color(0xFFC1C1C1)-private val CapsuleFill = Color(0xFF1A1A1A)-private val CapsuleEdge = Color(0xFF373737)+private val KeypadFill get() = if (Pc.light) Color(0xFFD1D3D8) else Color(0xFF1A1A1A)+private val DigitFill get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF525252)+private val KeyFill get() = if (Pc.light) Color(0xFFABB2BB) else Color(0xFF2B2B2B)+private val UnitChosen get() = if (Pc.light) Color(0xFF818C96) else Color(0xFFA1A1A1)+private val SwitchTrack get() = if (Pc.light) Color(0xFFD5D5D5) else Color(0xFF353535)+private val SwitchIdle get() = if (Pc.light) Color(0xFF3B3B3B) else Color(0xFFC1C1C1)+private val CapsuleFill get() = if (Pc.light) Color(0xFFFBFBFB) else Color(0xFF1A1A1A)+private val CapsuleEdge get() = if (Pc.light) Color(0xFFE0E0E0) else Color(0xFF373737)private val DoneBlue = Color(0xFF0190FF)/** The units sizes are typed in: the key's name, the unit's (as presets keep it) and its mark. */@@ -181,7 +181,7 @@ fun CustomCanvasScreen(vm: CanvasViewModel, onMade: () -> Unit) {color = Ink, fontSize = 22.sp, fontWeight = FontWeight.Bold,textAlign = if (wide) androidx.compose.ui.text.style.TextAlign.Center else androidx.compose.ui.text.style.TextAlign.Start,),- cursorBrush = SolidColor(Color.White),+ cursorBrush = SolidColor(Pc.Accent),modifier = if (wide) {Modifier.padding(start = 372.dp, end = 32.dp).offset(y = 28.dp).fillMaxWidth()} else {@@ -379,7 +379,7 @@ private fun Keypad(modifier: Modifier, wide: Boolean, unit: SizeUnit, onUnit: (SRow(horizontalArrangement = Arrangement.spacedBy(30.dp)) {Column(verticalArrangement = Arrangement.spacedBy(down)) {for (u in listOf(SizeUnit.MILLIMETERS, SizeUnit.CENTIMETERS, SizeUnit.INCHES, SizeUnit.PIXELS)) {- Key(u.label, if (u == unit) UnitChosen else KeyFill, if (u == unit) Color(0xFF1F1F1F) else Ink, 15.sp, w, h) { onUnit(u) }+ Key(u.label, if (u == unit) UnitChosen else KeyFill, if (u != unit) Ink else if (Pc.light) Color.White else Color(0xFF1F1F1F), 15.sp, w, h) { onUnit(u) }}}Column(verticalArrangement = Arrangement.spacedBy(down)) {diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/GestureControlsUi.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/GestureControlsUi.ktindex 45afc96..3d65f7e 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/GestureControlsUi.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/GestureControlsUi.kt@@ -51,23 +51,23 @@ import io.github.artcraftandroid.procraft.canvas.GestureOptionsimport io.github.artcraftandroid.procraft.canvas.GesturePurposeimport io.github.artcraftandroid.procraft.canvas.GestureSettings-private val ScreenFill = Color(0xFF1F1F1F)-private val RailFill = Color(0xFF272727)-private val CardFill = Color(0xFF252525)-private val Ink = Color(0xFFC1C1C1)-private val Detail = Color(0xFF9A9A9A)-private val RailIdle = Color(0xFFAAAAAA)-private val Track = Color(0xFF414141)+private val ScreenFill get() = if (Pc.light) Color(0xFFF3F3F3) else Color(0xFF1F1F1F)+private val RailFill get() = if (Pc.light) Color(0xFFEBEBEB) else Color(0xFF272727)+private val CardFill get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF252525)+private val Ink get() = if (Pc.light) Color(0xFF414141) else Color(0xFFC1C1C1)+private val Detail get() = if (Pc.light) Color(0xFF6A6A6A) else Color(0xFF9A9A9A)+private val RailIdle get() = if (Pc.light) Color(0xFF3F3F3F) else Color(0xFFAAAAAA)+private val Track get() = if (Pc.light) Color(0xFFE5E5E5) else Color(0xFF414141)// a delay whose way of touching is off: a dark line and a dim knob, no blue-private val TrackOff = Color(0xFF1D1D1D)-private val KnobOff = Color(0xFF333333)+private val TrackOff get() = if (Pc.light) Color(0xFFE9E9EB) else Color(0xFF1D1D1D)+private val KnobOff get() = if (Pc.light) Color(0xFFD0D0D0) else Color(0xFF333333)private val DoneBlue = Color(0xFF0190FF)/** Where a wide screen's page starts and ends, beside the card of what gestures can do. */private val WideContentStart = 358.dpprivate val WideContentEnd = 28.dp-private val CardEdge = Color(0xFF373737)-private val PageInk = Color(0xFF797979)+private val CardEdge get() = if (Pc.light) Color(0xFFDADADA) else Color(0xFF373737)+private val PageInk get() = if (Pc.light) Color(0xFF3E3E3E) else Color(0xFF797979)/** What gestures can do, by icon and name on a card headed "Gesture controls" (a wide screen's). */@Composablediff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/GuideUi.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/GuideUi.ktindex 533ee6c..3bb1f3a 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/GuideUi.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/GuideUi.kt@@ -42,12 +42,14 @@ import io.github.artcraftandroid.procraft.core.SymmetryTypeimport kotlin.math.roundToIntimport kotlin.math.sqrt-private val GuideTop = Color(0xFF1F1F1F)-private val GuideButton = Color(0xFF1C1C1C)-private val GuideButtonEdge = Color(0xFF383838)-private val GuideTitle = Color(0xFFD8D8D8)+private val GuideTop get() = if (Pc.light) Color(0xFFE1E1E3) else Color(0xFF1F1F1F)+private val GuideButton get() = if (Pc.light) Color(0xFFF5F8F9) else Color(0xFF1C1C1C)+private val GuideButtonEdge get() = if (Pc.light) Color(0xFFDCDEDF) else Color(0xFF383838)+private val GuideTitle get() = if (Pc.light) Color(0xFF3A3A3A) else Color(0xFFD8D8D8)private val GuideDone = Color(0xFF0190FF)-private val GuideNote = Color(0xFF4A4A4A)+private val GuideNote get() = if (Pc.light) Color(0xFFB5B5B5) else Color(0xFF4A4A4A)+/** The toolbar's words: light, or dark grey with the light interface. */+private val GuideLabel get() = if (Pc.light) Color(0xFF414141) else Color(0xFFD0D0D0)private val GuideNodeCentre = Color(0xFF0A84FF)private val GuideNodeTurn = Color(0xFF30D158)@@ -118,7 +120,7 @@ fun GuideEditor(vm: CanvasViewModel) {Row(Modifier.align(Alignment.TopEnd).padding(top = 20.dp, end = 20.dp), verticalAlignment = Alignment.CenterVertically) {Box(Modifier.size(73.dp, 43.dp).clip(CircleShape).background(GuideButton).border(1.dp, GuideButtonEdge, CircleShape).tap { vm.closeGuideEditor(keep = false) },contentAlignment = Alignment.Center) {- Text("Cancel", color = GuideTitle, fontSize = 17.sp, maxLines = 1)+ Text("Cancel", color = if (Pc.light) Color(0xFF585858) else GuideTitle, fontSize = 17.sp, maxLines = 1)}Spacer(Modifier.width(13.dp))Box(Modifier.size(44.dp).clip(CircleShape).background(GuideDone).tap { vm.closeGuideEditor(keep = true) }, contentAlignment = Alignment.Center) {@@ -203,12 +205,12 @@ private fun GuideToolbar(vm: CanvasViewModel, modifier: Modifier) {Modifier.size(257.dp, 40.dp).clip(RoundedCornerShape(20.dp)).background(Color(0xFF303030)).tap { vm.symmetryOptionsOpen = !vm.symmetryOptionsOpen },contentAlignment = Alignment.Center,) {- Text("Options", color = Color(0xFFD0D0D0), fontSize = 15.sp, maxLines = 1)+ Text("Options", color = GuideLabel, fontSize = 15.sp, maxLines = 1)}GuideType.PERSPECTIVE -> Unit}Spacer(Modifier.weight(1f))- Text("Assisted Drawing", color = Color(0xFFD0D0D0), fontSize = 15.sp, maxLines = 1)+ Text("Assisted Drawing", color = GuideLabel, fontSize = 15.sp, maxLines = 1)Box(Modifier.tap { vm.setGuideAssisted(!g.assisted) }) { Switch(g.assisted, enabled = true) }}}@@ -235,7 +237,7 @@ private fun GuideToolbar(vm: CanvasViewModel, modifier: Modifier) {Modifier.size(300.dp, 40.dp).clip(RoundedCornerShape(20.dp)).background(Color(0xFF303030)).tap { vm.symmetryOptionsOpen = !vm.symmetryOptionsOpen },contentAlignment = Alignment.Center,) {- Text("Options", color = Color(0xFFD0D0D0), fontSize = 15.sp, maxLines = 1)+ Text("Options", color = GuideLabel, fontSize = 15.sp, maxLines = 1)}}}@@ -245,7 +247,7 @@ private fun GuideToolbar(vm: CanvasViewModel, modifier: Modifier) {@Composableprivate fun AssistedSwitch(vm: CanvasViewModel, on: Boolean) {Row(Modifier.width(300.dp).padding(start = 8.dp), verticalAlignment = Alignment.CenterVertically) {- Text("Assisted Drawing", color = Color(0xFFD0D0D0), fontSize = 15.sp, maxLines = 1, modifier = Modifier.weight(1f))+ Text("Assisted Drawing", color = GuideLabel, fontSize = 15.sp, maxLines = 1, modifier = Modifier.weight(1f))Box(Modifier.tap { vm.setGuideAssisted(!on) }) { Switch(on, enabled = true) }}}diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/LayersPanel.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/LayersPanel.ktindex 0cc468e..8ade55b 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/LayersPanel.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/LayersPanel.kt@@ -883,10 +883,8 @@ private fun LayerOptions(open: Boolean, vm: CanvasViewModel, l: LayerInfo, rowY:Option("Alpha Lock", checked = l.alphaLock) { vm.toggleAlphaLock(l) }Option("Mask", enabled = !vm.hasMask(l), onClick = then { vm.addMask(l) })if (l.canClip) Option("Clipping Mask", checked = l.clipped) { vm.toggleClipped(l) }- // only while the drawing guide is on- if (vm.guide?.on == true) {- Option("Drawing Assist", checked = vm.guide?.assisted == true) { vm.setGuideAssisted(vm.guide?.assisted != true) }- }+ // offered with the drawing guide on or off+ Option("Drawing Assist", checked = vm.guide?.assisted == true) { vm.setGuideAssisted(vm.guide?.assisted != true) }if (!l.text) Option("Invert", enabled = !l.locked, onClick = then { vm.invertLayer(l) })Option("Reference", checked = l.reference) { vm.toggleReference(l) }}@@ -922,7 +920,7 @@ private fun Option(label: String, checked: Boolean? = null, enabled: Boolean = tval color = when {!enabled -> Pc.MenuDisableddestructive -> Color(0xFFFF453A)- else -> Color.White+ else -> Pc.MenuInk}Text(label, color = color, fontSize = 17.sp, modifier = Modifier.weight(1f))if (checked == true) Icon(PcIcons.Tick, contentDescription = null, tint = color, modifier = Modifier.size(18.dp))diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ReferenceUi.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ReferenceUi.ktindex 7199cc8..4e2f286 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ReferenceUi.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ReferenceUi.kt@@ -44,15 +44,15 @@ import androidx.compose.ui.unit.spimport io.github.artcraftandroid.procraft.canvas.CanvasViewModelimport kotlin.math.roundToInt-private val BarFill = Color(0xFF393939)-private val PictureFill = Color(0xFF262626)-private val GrabLine = Color(0xFF7C7C7C)-private val TitleInk = Color(0xFFC5C5C5)-private val CloseFill = Color(0xFF262626)-private val CloseEdge = Color(0xFF454545)-private val CloseInk = Color(0xFFA5A5A5)-private val SegmentTrack = Color(0xFF4D4D4D)-private val Muted = Color(0xFFAAAAAA)+private val BarFill get() = if (Pc.light) Color(0xFFEDEDED) else Color(0xFF393939)+private val PictureFill get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF262626)+private val GrabLine get() = if (Pc.light) Color(0xFF909090) else Color(0xFF7C7C7C)+private val TitleInk get() = if (Pc.light) Color(0xFF3A3A3A) else Color(0xFFC5C5C5)+private val CloseFill get() = if (Pc.light) Color(0xFFFAFAFA) else Color(0xFF262626)+private val CloseEdge get() = if (Pc.light) Color(0xFFE0E0E0) else Color(0xFF454545)+private val CloseInk get() = if (Pc.light) Color(0xFF595959) else Color(0xFFA5A5A5)+private val SegmentTrack get() = if (Pc.light) Color(0xFFD7D7D7) else Color(0xFF4D4D4D)+private val Muted get() = if (Pc.light) Color(0xFF3B3B3B) else Color(0xFFAAAAAA)private val TopBarHeight = 64.dpprivate val BottomBarHeight = 45.dpprivate val ReferenceCorner = 24.dpdiff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/SourceEditorUi.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/SourceEditorUi.ktindex fc97863..2b92508 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/SourceEditorUi.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/SourceEditorUi.kt@@ -60,22 +60,22 @@ import io.github.artcraftandroid.procraft.core.SourceKindimport kotlin.math.roundToIntimport kotlinx.coroutines.launch-private val EditorPage = Color(0xFF2A2A2A)-private val EditorView = Color(0xFF262626)-private val EditorTitle = Color(0xFFEEEEEE)-private val CapsuleFill = Color(0xFF1C1C1C)-private val CapsuleEdge = Color(0xFF383838)-private val CapsuleInk = Color(0xFFAAAAAA)+private val EditorPage get() = if (Pc.light) Color(0xFFE5E5E5) else Color(0xFF2A2A2A)+private val EditorView get() = if (Pc.light) Color(0xFFE5E5E5) else Color(0xFF262626)+private val EditorTitle get() = if (Pc.light) Color(0xFF333333) else Color(0xFFEEEEEE)+private val CapsuleFill get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF1C1C1C)+private val CapsuleEdge get() = if (Pc.light) Color(0xFFE0E0E0) else Color(0xFF383838)+private val CapsuleInk get() = if (Pc.light) Color(0xFF585858) else Color(0xFFAAAAAA)private val DoneBlue = Color(0xFF0190FF)-private val RepeatLabel = Color(0xFF808080)+private val RepeatLabel get() = if (Pc.light) Color(0xFF808080) else Color(0xFF808080)private val LibraryVeil = Color(0x80000000)-private val LibrarySheet = Color(0xFF1C1C1E)-private val LibraryTitle = Color(0xFFC1C1C1)-private val LibraryDim = Color(0xFF868686)-private val LibraryEdge = Color(0xFF5A5A5A)-private val LibrarySearchFill = Color(0xFF1B1B1B)-private val LibrarySearchEdge = Color(0xFF363636)-private val LibraryHint = Color(0xFF787878)+private val LibrarySheet get() = if (Pc.light) Color(0xFFF2F2F7) else Color(0xFF1C1C1E)+private val LibraryTitle get() = if (Pc.light) Color(0xFF3A3A3A) else Color(0xFFC1C1C1)+private val LibraryDim get() = if (Pc.light) Color(0xFF868686) else Color(0xFF868686)+private val LibraryEdge get() = if (Pc.light) Color(0xFFC8C8C8) else Color(0xFF5A5A5A)+private val LibrarySearchFill get() = if (Pc.light) Color(0xFFE6E6EA) else Color(0xFF1B1B1B)+private val LibrarySearchEdge get() = if (Pc.light) Color(0xFFD8D8DC) else Color(0xFF363636)+private val LibraryHint get() = if (Pc.light) Color(0xFF8A8A8E) else Color(0xFF787878)private val MenuBlue = Color(0xFF0A84FF)/**@@ -367,7 +367,7 @@ private fun SourceLibrary(vm: CanvasViewModel, grain: Boolean, onPick: (Int) ->Row(Modifier.padding(start = 43.dp, top = 25.dp).height(45.dp), verticalAlignment = Alignment.CenterVertically) {for ((label, isGrain) in listOf("Shape Source" to false, "Grain Source" to true)) {Box(Modifier.padding(end = 11.dp).size(115.dp, 41.dp).tap { showGrains = isGrain }, contentAlignment = Alignment.Center) {- Text(label, color = if (showGrains == isGrain) Color.White else LibraryDim, fontSize = 17.sp, maxLines = 1)+ Text(label, color = if (showGrains == isGrain) Pc.MenuInk else LibraryDim, fontSize = 17.sp, maxLines = 1)}}Spacer(Modifier.width(8.dp))@@ -422,7 +422,7 @@ private fun LibrarySearch(query: String, onQuery: (String) -> Unit) {query,onValueChange = onQuery,singleLine = true,- textStyle = androidx.compose.ui.text.TextStyle(color = Color.White, fontSize = 17.sp),+ textStyle = androidx.compose.ui.text.TextStyle(color = Pc.MenuInk, fontSize = 17.sp),cursorBrush = androidx.compose.ui.graphics.SolidColor(Pc.Accent),modifier = Modifier.fillMaxWidth(),)diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/TextUi.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/TextUi.ktindex 1950d6e..3b1a695 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/TextUi.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/TextUi.kt@@ -72,18 +72,23 @@ import io.github.artcraftandroid.procraft.core.TextAlignmentimport io.github.artcraftandroid.procraft.core.TextInfoimport kotlin.math.roundToInt-private val SheetFill = Color(0xFF535353)-private val SheetBar = Color(0xFF4F4F4F)-private val SheetCapsule = Color(0xFF3E3E3E)-private val CardFill = Color(0xFF373737)+private val SheetFill get() = if (Pc.light) Color(0xFFF3F6F7) else Color(0xFF535353)+private val SheetBar get() = if (Pc.light) Color(0xFFF3F6F7) else Color(0xFF4F4F4F)+private val SheetCapsule get() = if (Pc.light) Color(0xFFFBFBFB) else Color(0xFF3E3E3E)+private val CardFill get() = if (Pc.light) Color(0xFFFAFAFA) else Color(0xFF373737)private val CardCorner = 22.dp-private val ButtonFill = Color(0xFF474747)-private val SegmentTrack = Color(0xFF646464)-private val CapsuleInk = Color(0xFFC5C5C5)-private val KeyboardDisc = Color(0xFF393939)-private val KeyboardBar = Color(0xFF2B2B2B)+private val ButtonFill get() = if (Pc.light) Color(0xFFE6E6E6) else Color(0xFF474747)+private val SegmentTrack get() = if (Pc.light) Color(0xFFE3E3E3) else Color(0xFF646464)+private val CapsuleInk get() = if (Pc.light) Color(0xFF565656) else Color(0xFFC5C5C5)+private val KeyboardDisc get() = if (Pc.light) Color(0xFFFBFBFB) else Color(0xFF393939)+private val KeyboardBar get() = if (Pc.light) Color(0xFFE9ECED) else Color(0xFF2B2B2B)private val DoneBlue = Color(0xFF0190FF)private val BoxLine = Color(0xFF0076FD)+/** The sheet's words: white, black on the light interface. */+// a design row's track and the middle tick of one that runs both ways+private val DesignTrack get() = if (Pc.light) Color(0xFFE3E3E3) else Color(0xFF5A5A5A)+private val DesignTick get() = if (Pc.light) Color(0xFFC8C8C8) else Color(0xFF8A8A8A)+private val SheetInk get() = if (Pc.light) Color.Black else Color.White/*** Text being edited: its box drawn over the canvas, a hidden field the keyboard types into, and a@@ -393,7 +398,7 @@ private fun AttributesCard(vm: CanvasViewModel, info: TextInfo, modifier: Modifi}Row(Modifier.padding(top = if (wide) 4.dp else 0.dp).clickable { vm.changeText { it.copy(allCaps = !it.allCaps) } }, verticalAlignment = Alignment.CenterVertically) {// two serif capitals all but touching- Text("TT", color = Color.White, fontSize = 26.5.sp, fontFamily = FontFamily.Serif, letterSpacing = (-0.5).sp, modifier = Modifier.padding(start = 10.dp).width(50.5.dp))+ Text("TT", color = SheetInk, fontSize = 26.5.sp, fontFamily = FontFamily.Serif, letterSpacing = (-0.5).sp, modifier = Modifier.padding(start = 10.dp).width(50.5.dp))if (wide) Spacer(Modifier.weight(1f))Switch(info.allCaps, enabled = true)}@@ -412,7 +417,7 @@ private fun SheetIcon(icon: ImageVector, label: String, modifier: Modifier, icon@Composableprivate fun Card(title: String, modifier: Modifier, shape: RoundedCornerShape = RoundedCornerShape(CardCorner), content: @Composable ColumnScope.() -> Unit) {Column(modifier.fillMaxHeight().clip(shape).background(CardFill)) {- Text(title, color = Color.White, fontSize = 17.sp, fontWeight = FontWeight.SemiBold, modifier = Modifier.padding(start = 20.dp, top = 16.5.dp, bottom = 9.dp))+ Text(title, color = SheetInk, fontSize = 17.sp, fontWeight = FontWeight.SemiBold, modifier = Modifier.padding(start = 20.dp, top = 16.5.dp, bottom = 9.dp))content()}}@@ -425,7 +430,7 @@ private fun Cell(name: String, selected: Boolean, face: android.graphics.TypefacModifier.fillMaxWidth().height(33.dp).background(if (selected) Pc.Accent else Color.Transparent).clickable(onClick = onClick).padding(start = 12.dp),contentAlignment = Alignment.CenterStart,) {- Text(name, color = Color.White, fontSize = 15.sp, fontFamily = family, maxLines = 1)+ Text(name, color = if (selected) Color.White else SheetInk, fontSize = 15.sp, fontFamily = family, maxLines = 1)}}@@ -436,7 +441,7 @@ private fun Attribute(icon: ImageVector, label: String, on: Boolean, modifier: Mmodifier.height(tall).clip(RoundedCornerShape(8.dp)).background(if (on) Pc.Accent else ButtonFill).clickable(onClick = onClick),contentAlignment = Alignment.Center,) {- Icon(icon, contentDescription = label, tint = Color.White, modifier = Modifier.requiredSize(iconSize))+ Icon(icon, contentDescription = label, tint = if (on) Color.White else SheetInk, modifier = Modifier.requiredSize(iconSize))}}@@ -446,9 +451,9 @@ private fun DesignRow(label: String, value: Float, shown: String, fromMiddle: Boval change by rememberUpdatedState(onChange)Column(Modifier.fillMaxWidth().height(58.5.dp).padding(horizontal = 16.dp)) {Row(Modifier.fillMaxWidth().padding(top = 1.5.dp), verticalAlignment = Alignment.CenterVertically) {- Text(label, color = Color.White, fontSize = 15.sp, modifier = Modifier.weight(1f))+ Text(label, color = SheetInk, fontSize = 15.sp, modifier = Modifier.weight(1f))Box(Modifier.height(24.dp).clip(CircleShape).background(ButtonFill).padding(horizontal = 10.dp), contentAlignment = Alignment.Center) {- Text(shown, color = Color.White, fontSize = 13.sp)+ Text(shown, color = SheetInk, fontSize = 13.sp)}}Box(@@ -468,9 +473,9 @@ private fun DesignRow(label: String, value: Float, shown: String, fromMiddle: Boval y = size.height / 2fval h = 2.dp.toPx()val v = value.coerceIn(0f, 1f)- drawRoundRect(Color(0xFF5A5A5A), Offset(0f, y - h / 2f), Size(size.width, h), CornerRadius(h / 2f))+ drawRoundRect(DesignTrack, Offset(0f, y - h / 2f), Size(size.width, h), CornerRadius(h / 2f))if (fromMiddle) {- drawLine(Color(0xFF8A8A8A), Offset(size.width / 2f, y - 5.dp.toPx()), Offset(size.width / 2f, y + 5.dp.toPx()), 1.dp.toPx())+ drawLine(DesignTick, Offset(size.width / 2f, y - 5.dp.toPx()), Offset(size.width / 2f, y + 5.dp.toPx()), 1.dp.toPx())} else {drawRoundRect(Pc.Accent, Offset(0f, y - h / 2f), Size(size.width * v, h), CornerRadius(h / 2f))}diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/Theme.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/Theme.ktindex 6e4e76f..589aad0 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/Theme.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/Theme.kt@@ -27,7 +27,8 @@ object Pc {// the bar across the top of the canvas/** Translucent: #333333 over white, as the reference's bar. */- val Bar: Color get() = pick(0xE61C1C1C, 0xF2E7E7E7)+ // light, see-through enough to read 226 over the light surround and 235 over white+ val Bar: Color get() = pick(0xE61C1C1C, 0xCFE6E6E6)val BarText: Color get() = pick(0xFFAAAAAA, 0xFF3B3B3B)val BarGlyph: Color get() = pick(0xFFC7C7C7, 0xFF373737)val BarGlyphSelected = Color(0xFF0076FD)@@ -81,6 +82,8 @@ object Pc {val HexRow: Color get() = pick(0xFF414141, 0xFFD8D8D8)val HexField: Color get() = pick(0xFF4B4B4B, 0xFFCFCFCF)val MenuFill: Color get() = pick(0xFF5A5C5B, 0xFFF0F0F0)+ /** A menu's words: white, black on the light interface's menus. */+ val MenuInk: Color get() = pick(0xFFFFFFFF, 0xFF000000)/** The small frosted menus: over the canvas what is behind shows through, blurred. */val GlassMenu: Color get() = pick(0xCF313135, 0xFAF0F0F0)/** A small menu over a panel: the panel can't show through blurred, so it is nearly solid, grey. */@@ -119,13 +122,13 @@ object Pc {return BarMargin + GalleryWidth + gap + BarButtonWidth / 2 + (BarButtonWidth + gap) * index}- // the gallery- val GalleryBackground = Color(0xFF212121)- val GalleryTitle = Color(0xFFF0F0F0)- val GalleryText = Color(0xFFAAAAAA)- val GallerySize = Color(0xFF666666)- val Capsule = Color(0xFF1C1C1C)- val CapsuleEdge = Color(0xFF393939)+ // the gallery; light, near white with dark grey inks and a frosted white capsule+ val GalleryBackground: Color get() = pick(0xFF212121, 0xFFF0F0F0)+ val GalleryTitle: Color get() = pick(0xFFF0F0F0, 0xFF3C3C3C)+ val GalleryText: Color get() = pick(0xFFAAAAAA, 0xFF595959)+ val GallerySize: Color get() = pick(0xFF666666, 0xFF6A6A6A)+ val Capsule: Color get() = pick(0xFF1C1C1C, 0xF0F7F7F7)+ val CapsuleEdge: Color get() = pick(0xFF393939, 0x0F000000)val LightPanel = Color(0xFFD5D5D5)val LightText = Color(0xFF393939)val LightRowStrong = Color(0xFFE1E1E1)@@ -136,11 +139,11 @@ object Pc {// the side bar// the bar and the tracks translucent, each straight over what is behind (#2d2d2d and #676767// over white); the thumbs opaque (#a6a6a6 over white and over the dark surround alike)- val SideBar: Color get() = pick(0xE7171717, 0xF2E8E8E8)- val SliderTrack: Color get() = pick(0xC93E3E3E, 0xFFEDEDED)+ val SideBar: Color get() = pick(0xE7171717, 0xCFE5E5E5)+ val SliderTrack: Color get() = pick(0xC93E3E3E, 0xFFE9E9E9)// a lighter rim round each track, more of what is behind showing through it (#5a5a5a over the// dark surround, #969696 over white)- val SliderRim: Color get() = pick(0xB96E6E6E, 0xFFEDEDED)+ val SliderRim: Color get() = pick(0xB96E6E6E, 0xFFE9E9E9)val SliderRimWidth = 0.8.dpval SliderThumb: Color get() = pick(0xFFA6A6A6, 0xFFF8F8F8)val SideGlyph: Color get() = pick(0xFF969696, 0xFF646464)diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/TimeLapseUi.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/TimeLapseUi.ktindex 22465f3..b1a9d24 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/TimeLapseUi.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/TimeLapseUi.kt@@ -33,8 +33,9 @@ import kotlinx.coroutines.Dispatchersimport kotlinx.coroutines.delayimport kotlinx.coroutines.withContext-private val ReplayFill = Color(0xFF252525)-private val GridLine = Color(0xFF2E2E2E)+// the canvas's surround and grid, light with the light interface+private val ReplayFill get() = if (Pc.light) Color(0xFFCED1D2) else Color(0xFF252525)+private val GridLine get() = if (Pc.light) Color(0xFFCACDCE) else Color(0xFF2E2E2E)/*** The surround's grid drawn as the canvas draws it (1 1/3 pt lines every 16, fixed to the glass@@ -105,7 +106,7 @@ fun TimeLapseReplay(vm: CanvasViewModel) {val frames = indexval seconds = frames / TimeLapse.FPSval time = "%02d:%02d:%02d:%02d".format(seconds / 3600, seconds / 60 % 60, seconds % 60, frames % TimeLapse.FPS)- ToolHeader("Time-lapse Replay", listOf(ToolButton(time)), onDone = { vm.timeLapseReplaying = false }, colors = LightToolHeader)+ ToolHeader("Time-lapse Replay", listOf(ToolButton(time)), onDone = { vm.timeLapseReplaying = false }, colors = if (Pc.light) DarkToolHeader else LightToolHeader)// how far it has playedBox(Modifier.padding(top = ToolHeaderHeight).fillMaxWidth().height(4.dp)) {val f = if (count > 1) index / (count - 1).toFloat() else 1fdiff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ToolHeader.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ToolHeader.ktindex ad29650..487444a 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ToolHeader.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/ToolHeader.kt@@ -25,10 +25,10 @@ import androidx.compose.ui.text.font.FontWeightimport androidx.compose.ui.unit.dpimport androidx.compose.ui.unit.sp-private val HeaderLabel = Color(0xFFC5C5C5)-private val ButtonLabel = Color(0xFFA5A5A5)-private val ChosenLabel = Color(0xFFC0C0C0)-private val CapsuleChosen = Color(0xFF464646)+private val HeaderLabel get() = if (Pc.light) Color(0xFF3A3A3A) else Color(0xFFC5C5C5)+private val ButtonLabel get() = if (Pc.light) Color(0xFF565656) else Color(0xFFA5A5A5)+private val ChosenLabel get() = if (Pc.light) Color(0xFF3A3A3A) else Color(0xFFC0C0C0)+private val CapsuleChosen get() = if (Pc.light) Color(0xFFA5A5A5) else Color(0xFF464646)private val DoneBlue = Color(0xFF0190FF)/** A full-screen tool's header is this tall. */@@ -40,8 +40,9 @@ class ToolButton(val label: String, val chosen: Boolean = false, val onClick: ((/** A tool header's colours: its band, and its capsule's fill and edge. */class ToolHeaderColors(val band: Color, val capsule: Color, val edge: Color)-/** Over the dark surround of a tool that edits the canvas. */-val DarkToolHeader = ToolHeaderColors(Color(0xFF1D1D1D), Color(0xFF1A1A1A), Color(0xFF373737))+/** Over the surround of a tool that edits the canvas: dark, or light with the light interface (then every tool's header is this one). */+val DarkToolHeader get() = if (Pc.light) ToolHeaderColors(Color(0xFFDFE2E3), Color(0xFFF5F8F9), Color(0xFFDCDEDF))+ else ToolHeaderColors(Color(0xFF1D1D1D), Color(0xFF1A1A1A), Color(0xFF373737))/** Over a picture shown edge to edge. */val LightToolHeader = ToolHeaderColors(Color(0xFF333333), Color(0xFF232323), Color(0xFF424242))diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/TransformUi.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/TransformUi.ktindex cc73241..45404b5 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/TransformUi.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/ui/TransformUi.kt@@ -101,14 +101,15 @@ private val ToolbarWidth = 728.dpprivate val ToolbarHeight = 126.dpprivate val ToolbarBottom = 25.dpprivate val ToolbarCorner = 33.dp-// translucent: #282828 to #252525 over white, #212121 to #1e1e1e over the surround-private val ToolbarTop = Color(0xF7212121)-private val ToolbarFill = Color(0xF71E1E1E)-private val SegmentTrack = Color(0xFF535353)-private val SegmentEdge = Color(0xFF7E7E7E)-private val SegmentText = Color(0xFFC1C1C1)-private val ButtonText = Color(0xFFA3A3A3)-private val ButtonDimmed = Color(0xFF575757)+// translucent: #282828 to #252525 over white, #212121 to #1e1e1e over the surround; light, #f2f2f2+// with a white track, dark labels, and grey ones for what can't be used yet+private val ToolbarTop get() = if (Pc.light) Color(0xF7F2F2F2) else Color(0xF7212121)+private val ToolbarFill get() = if (Pc.light) Color(0xF7F2F2F2) else Color(0xF71E1E1E)+private val SegmentTrack get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF535353)+private val SegmentEdge get() = if (Pc.light) Color(0xFFEBEBEB) else Color(0xFF7E7E7E)+private val SegmentText get() = if (Pc.light) Color(0xFF3B3B3B) else Color(0xFFC1C1C1)+private val ButtonText get() = if (Pc.light) Color(0xFF414141) else Color(0xFFA3A3A3)+private val ButtonDimmed get() = if (Pc.light) Color(0xFF989898) else Color(0xFF575757)private val SegmentGap = 11.33.dp/** The transform toolbar's buttons: with room (landscape), and where the screen is narrow. */private val TransformButtonRoomy = 89.dp@@ -120,9 +121,9 @@ private val ButtonGap = 19.dpinternal val MenuWidth = 260.dpprivate val MenuArrow = 15.dpprivate val MenuCorner = 26.dp-private val MenuFill = Color(0xEB2A2A2A)-internal val MenuGroup = Color(0xFF313131)-internal val MenuLine = Color(0xFF373737)+private val MenuFill get() = if (Pc.light) Color(0xEBF0F0F0) else Color(0xEB2A2A2A)+internal val MenuGroup get() = if (Pc.light) Color(0xFFFFFFFF) else Color(0xFF313131)+internal val MenuLine get() = if (Pc.light) Color(0xFFE2E2E2) else Color(0xFF373737)internal val MenuText: Color get() = if (Pc.light) Color(0xFF393939) else Color(0xFFC5C5C5)internal val MenuGroupCorner = 13.dp@@ -579,4 +580,4 @@ private fun MenuSlider(value: Float, onChange: (Float) -> Unit, modifier: Modifi/** Where the slider's knob centre runs, from the row's left edge and from its right. */private val SliderStart = 21.5.dpprivate val SliderEnd = 15.dp-private val SliderRest = Color(0xFF5A5A5A)+private val SliderRest get() = if (Pc.light) Color(0xFFDDDDDD) else Color(0xFF5A5A5A)diff --git a/apps/procraft-android/src/lib.rs b/apps/procraft-android/src/lib.rsindex 4f48362..a64896c 100644--- a/apps/procraft-android/src/lib.rs+++ b/apps/procraft-android/src/lib.rs@@ -49,15 +49,20 @@ use procraft_engine::stroke::StrokeBuilder;use procraft_engine::view::View;use procraft_gpu::{Canvas, Gpu, StrokeStyle, StrokeTool};-/// Colour around the canvas, sRGB.+/// Colour around the canvas, sRGB; and with the light interface.#[cfg_attr(not(target_os = "android"), allow(dead_code))]pub(crate) const SURROUND: [f32; 3] = [37.0 / 255.0, 37.0 / 255.0, 37.0 / 255.0];+#[cfg_attr(not(target_os = "android"), allow(dead_code))]+pub(crate) const SURROUND_LIGHT: [f32; 3] = [206.0 / 255.0, 209.0 / 255.0, 210.0 / 255.0];/// The grid over the surround: its line colour (sRGB), and its spacing, line width (a point, its/// edges smoothed a third of a pixel out on a 2x screen) and top (the bar's height, none under/// it), in interface points. It is fixed to the glass: see [`CanvasSession::set_grid_origin`].#[cfg_attr(not(target_os = "android"), allow(dead_code))]pub(crate) const GRID_LINE: [f32; 3] = [46.0 / 255.0, 46.0 / 255.0, 46.0 / 255.0];+/// The grid's lines with the light interface: a little darker than its surround.+#[cfg_attr(not(target_os = "android"), allow(dead_code))]+pub(crate) const GRID_LINE_LIGHT: [f32; 3] = [202.0 / 255.0, 205.0 / 255.0, 206.0 / 255.0];#[cfg_attr(not(target_os = "android"), allow(dead_code))]pub(crate) const GRID_SPACING_PT: f32 = 16.0;#[cfg_attr(not(target_os = "android"), allow(dead_code))]@@ -298,6 +303,8 @@ pub(crate) struct State {/// Where the middle of one of the surround grid's lines is, across and down (window pixels);/// none given, half a point in from the top-left corner.grid_origin: Option<[f32; 2]>,+ /// The light interface: a light surround and grid.+ light: bool,/// The document before a continuous change (a slider drag) began.pending_doc: Option<Document>,/// What undo calls that change.@@ -383,10 +390,16 @@ impl State {origin: [x + by.x, y + by.y],top: GRID_TOP_PT * s + by.y,width: GRID_WIDTH_PT * s,- color: GRID_LINE,+ color: if self.light { GRID_LINE_LIGHT } else { GRID_LINE },}}+ /// The colour around the canvas.+ #[cfg_attr(not(target_os = "android"), allow(dead_code))]+ pub(crate) fn surround(&self) -> [f32; 3] {+ if self.light { SURROUND_LIGHT } else { SURROUND }+ }+/// The whole canvas fitted in the window, clear of the insets, turned by the right angle the/// view is nearest (fitting straightens a turned canvas, but keeps it on its side if it is).pub(crate) fn fitted_view(&self) -> View {@@ -703,6 +716,7 @@ impl CanvasSession {error: None,display_scale: 2.0,grid_origin: None,+ light: false,pending_doc: None,pending_name: None,info: project::ArtworkInfo {@@ -1027,6 +1041,13 @@ impl CanvasSession {}}+ /// The light interface: the surround and its grid go light.+ pub fn set_light_interface(&self, on: bool) {+ let mut st = self.shared.lock();+ st.light = on;+ self.shared.frame(&mut st);+ }+/// Fits the whole canvas in the window again, at once.pub fn fit_view(&self) {let mut st = self.shared.lock();diff --git a/apps/procraft-android/src/pick.rs b/apps/procraft-android/src/pick.rsindex 77adad5..6f8b165 100644--- a/apps/procraft-android/src/pick.rs+++ b/apps/procraft-android/src/pick.rs@@ -3,7 +3,7 @@use procraft_engine::geom::{Affine, Vec2};use procraft_gpu::{Target, read_texture, wgpu};-use crate::{CanvasSession, SURROUND};+use crate::CanvasSession;/// What the eyedropper sees.#[derive(Clone, Debug, uniffi::Record)]@@ -28,6 +28,7 @@ impl CanvasSession {// the window shifted so that the point lands in the middle of the small targetlet corner = Vec2::new(x - side as f32 / 2.0, y - side as f32 / 2.0);let grid = st.surround_grid(Vec2::ZERO - corner);+ let surround = st.surround();let (Some(canvas), Some(gpu)) = (st.canvas.as_mut(), st.gpu.as_ref()) else { return None };let format = wgpu::TextureFormat::Rgba8Unorm;let texture = gpu.device.create_texture(&wgpu::TextureDescriptor {@@ -50,7 +51,7 @@ impl CanvasSession {format,size: (side, side),to_screen,- surround: SURROUND,+ surround,grid: Some(grid),selection: None,backdrop: None,diff --git a/apps/procraft-android/src/render.rs b/apps/procraft-android/src/render.rsindex 0121712..e17b535 100644--- a/apps/procraft-android/src/render.rs+++ b/apps/procraft-android/src/render.rs@@ -11,8 +11,7 @@ use procraft_gpu::{Backdrop, Gpu, SelectionLook, Stripes, Target, wgpu};use crate::selection::SelectionDisplay;use crate::{- BACKDROP_SIGMA_PT, SELECTION_FILL, SELECTION_TINT, STRIPE_COVERAGE, STRIPE_PERIOD_PT, STRIPE_SPEED_PT, SURROUND,- Shared,+ BACKDROP_SIGMA_PT, SELECTION_FILL, SELECTION_TINT, STRIPE_COVERAGE, STRIPE_PERIOD_PT, STRIPE_SPEED_PT, Shared,};pub(crate) fn run(shared: Arc<Shared>, window: NativeWindow) {@@ -111,6 +110,7 @@ pub(crate) fn run(shared: Arc<Shared>, window: NativeWindow) {}let to_screen = st.view.map(|v| v.to_screen());let grid = st.surround_grid(Vec2::ZERO);+ let surround = st.surround();// a model is drawn in place of the flat canvas, and the drawing pad may be a sphereif st.scene_shown() {let convert = colours_to(st.doc.profile, screen);@@ -157,7 +157,7 @@ pub(crate) fn run(shared: Arc<Shared>, window: NativeWindow) {format,size,to_screen,- surround: SURROUND,+ surround,grid: Some(grid),selection: look,backdrop,