add ability to select cursor colour

This commit is contained in:
2025-08-09 07:04:03 +01:00
parent 7a3fc728f6
commit fa2a5c878c
6 changed files with 72 additions and 1 deletions

View File

@@ -263,6 +263,16 @@ struct
fun updateBlue model = (AppWith.b model, [])
fun updateAlpha model = (AppWith.a model, [])
fun selectCursorColour (model: app_type) =
let
val {squares, arrowX, arrowY, ...} = model
val yAxis = Vector.sub (squares, arrowX)
val {r, g, b, a} = Vector.sub (yAxis, arrowY)
val model = AppWith.cursorColour (model, r, g, b, a)
in
(model, [])
end
fun updateCanvas (model, canvasWidth, canvasHeight) =
let
val
@@ -359,6 +369,7 @@ struct
| KEY_G => updateGreen model
| KEY_B => updateBlue model
| KEY_A => updateAlpha model
| KEY_C => selectCursorColour model
| KEY_W => updateCanvasWidth model
| KEY_H => updateCanvasHeight model
| KEY_M => enterMoveMode model