change how modal num works so that it is only clipped to 255 if setting a new colour/alpha value

This commit is contained in:
2025-07-11 17:30:57 +01:00
parent ac69e95a0c
commit e760b158ac
3 changed files with 66 additions and 12 deletions

View File

@@ -247,14 +247,8 @@ struct
(model, drawMsg)
end
fun updateNum (model: app_type, inputNum) =
let
val oldNum = #modalNum model
val newNum = oldNum * 10 + inputNum
val newNum = if newNum > 255 then 0 else newNum
in
fun updateNum (model: app_type, newNum) =
(AppWith.modalNum (model, newNum), [])
end
fun updateRed model = (AppWith.r model, [])
fun updateGreen model = (AppWith.g model, [])