Type Library Revision Release 2024.3703 Keywords Material You Colors, Material UI Platforms Android Sample https://github.com/solar2d/com.solar2d-plugin.materialYouColors/tree/master/demo
The Material You Colors plugin get Material UI colors set in System Settings by the user.
This plugin is only supported on Android 12+ (Android API Level 31+) and only works with Solar2D 3672+
local materialYouColors = require( "plugin.materialYouColors" )
returns a 3d Array of all system colors: 1d contains 5 color groups accent colors 1,2,3 and neutral colors 1,2, 2d contains 13 different shades of the color with 1 being the lightest, and 13 being the darkest, and 3d contains red, greed, blue(in that order)
local myColors = materialYouColors.getColors() local color = display.newRect( display.contentCenterX, display.contentCenterY, 50, 50 ) color:setFillColor(myColors[1][4][1], myColors[1][4][2], myColors[1][4][3])
To use this plugin, add an entry into the plugins
table of build.settings
. When added, the build server will integrate the plugin during the build phase.
settings = { plugins = { ["plugin.materialYouColors"] = { publisherId = "com.solar2d" }, }, }