C O L O R
Todo: Documentation for Color
In order to use Color, you must first load the plugin at the top of your script
using the LoadPlugin method like this:
app.LoadPlugin( "Support" );
Colors:
- RED
- PINK
- PURPLE
- DEEP_PURPLE
- INDIGO
- BLUE
- LIGHT_BLUE
- CYAN
- TEAL
- GREEN
- LIGHT_GREEN
- LIME
- YELLOW
- AMBER
- ORANGE
- DEEP_ORANGE
- BROEN
- GREY
- BLUE_GREY
- BLACK
- WHITE
- TRANS - transparent
Masks:
- LIGHT_1
- LIGHT_2
- LIGHT_3
- LIGHT_4
- LIGHT_5
- DARK_1
- DARK_2
- DARK_3
- DARK_4
- ACCENT_1
- ACCENT_2
- ACCENT_3
- ACCENT_4
For red text: color.RED
For dark red color.RED_DARK_1
Examples:
color.GetRandomColor( mask );
Example - Get Random Color
app.LoadPlugin( "Support" );
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
btn = app.CreateButton( "Change Color" );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
app.AddLayout( lay );
}
function btn_OnTouch()
{
app.SetBackColor( color.GetRandomColor() );
}
mask: white or black
Example - Get Random Color For White Text
app.LoadPlugin( "Support" );
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
btn = app.CreateButton( "Change Color" );
btn.SetBackColor( color.BLUE );
btn.SetTextColor( color.WHITE );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
app.AddLayout( lay );
}
function btn_OnTouch()
{
app.SetBackColor( color.GetRandomColor( "white" ) );
}
color.ShowColorPicker( title, callback, options );
options: NoTitle - NoDim - NoCancel
Example - Color Picker
app.LoadPlugin( "Support" );
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
btn = app.CreateButton( "Change Color" );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
app.AddLayout( lay );
}
function btn_OnTouch()
{
color.ShowColorPicker( "Colors", OnSelectColor );
}
function OnSelectColor( hexcode, name )
{
app.Alert( hexcode, name );
app.SetBackColor( hexcode );
}
Helper plugin for Support
thanks for using
Version: 1.0