#If Java
import android.graphics.Color;
public float[] gethsv(int colorin) {
float[] hsv = new float[3];
Color.colorToHSV(colorin, hsv);
return hsv;
}
#End If
Sub gethuecolor(Colorin As Int) As Float()
Dim NativeMe As JavaObject
NativeMe.InitializeContext
Return NativeMe.RunMethod("gethsv", Array As Object(Colorin))
End Sub
Sub btn_setbackcolor_Click
Dim temp(3) As Float
Dim hsvset(4) As Object
temp = gethuecolor(something.BackColor)
hsvset(0) = temp(0)
hsvset(1) = temp(1)
hsvset(2) = temp(2)
hsvset(3) = 255
ColorTemplate.SelectedHSVColor=hsvset
Wait For (Dialog.ShowTemplate(ColorTemplate, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = XUI.DialogResponse_Positive Then
something.BackColor = ColorTemplate.SelectedColor
End If
End Sub