# ColourWheelEvent(ev:EventHandler) hash function
Please note the Android and Windows implementations of SimpleHMI have been deprecated. Both were little used and have been superseded by the HMI series of SPLat Controllers.
Valid for use with hash command: HMI.
Can also be spelled ColorWheelEvent.
Implemented on the following platforms: Android
Interactive Colour selector for RGB LED controls.
Displays a colour wheel image (colour picker) at the top of the screen, scaled to fill the width. Raises events (GoSub EventHandler
) as the Enduser moves the touch across the wheel. The non-coloured parts of the colour wheel image are transparent, so the background colour will show through. However, if the touch wanders into those areas the function returns black. The small dots provide pure R, G, B and white colours.
In EventHandler
you can retrieve the RGB colour values (range 0-255) by 3 successive COMRx_fGetNum 255
instructions.
The following screen capture shows the colour wheel. The buttons at the bottom are separately generated by the target app.
Example: Here is the code snippet from the target app.:
;------ Colour wheel ------------------
evWheel:
;Event called from top level menu
# HMI Reset() Cls() HideAllButtons()
# HMI ColourWheel(evColourWheel)
# HMI ButtonEvent(, 0.95, 0.6, 0.1, 0.4, "Capture", evSaveMood)
GoSub MakeBackButton
Return ;New colour input from the colour wheel
evColourWheel:
LaunchTask tskCW
COMRx_fGetNum 255
fix
Store bTriRed ;Byte variable, defined elsewhere
COMRx_fGetNum 255
fix
Store bTriGreen
COMRx_fGetNum 255
fix
Store bTriBlue
GoSub UpdateTriLED ;Updates the RGB LED
Return
tskCW: ;(Diagnostic) Flash a front panel LED on MS120
On 11
Pause 10
Off 11
KillTask
MakeBackButton:
# HMI ButtonEvent(, 0.95, 0.0, 0.1, 0.4, "Main menu", evTopMenu)
Return