Colour effects

The CameraView allows you to add colour effects to the picture.

This demo shows which effects are available on your device.

The code

colorEffects.js
var lay,layMnu,cam,lst;
function OnStart() 
{ 
    lay = app.CreateLayout( "Absolute" );
    layMnu = app.CreateLayout( "Absolute" );
  
    cam=app.CreateCameraView(1,1); 
    cam.SetOnReady(ready); 
    lay.AddChild(cam);
 
    var btn=app.CreateButton("[fa-bars]",-1,-1,"Custom.fontawesome");
    btn.SetStyle( "#6666ee66", "#6677ff77", 15, "#ff006600", 2, 0 ); 
    btn.SetTextColor("#224422");
    btn.SetOnTouch(toggleMenu);
    btn.SetPosition(0.8,0);
    lay.AddChild(btn); 
 
    lst=app.CreateList("",0.5);
    lst.SetBackColor("#cc77ff77");
    lst.SetTextColor("#ff224422");
    //lst.SetTextSize(14);
    lst.SetHiTextColor1("#ffddffdd");
    lst.SetOnTouch(effects);
    layMnu.SetPosition(0.5,0.1,0.5,1);
    layMnu.SetVisibility("Hide");
    layMnu.AddChild(lst);
    lay.AddChild(layMnu);
         
    app.AddLayout( lay ); 
} 
 
function toggleMenu()
{
    if(layMnu.GetVisibility()=="Hide")
    {
       layMnu.Animate("SlideFromRight");
       lay.ChildToFront(layMnu);
    }
    else
       layMnu.Animate("SlideToRight");      
}
 
function effects(item)
{
    cam.SetColorEffect(item);
    lst.SelectItem(item);
    layMnu.Animate("SlideToRight");
}
 
function ready() 
{ 
     var s = cam.GetColorEffects();
     lst.SetList(s);
     lst.SelectItem("none");
     layMnu.Animate("SlideToRight");
     cam.StartPreview();
}