Difference between revisions of "platform.window:setBackgroundColor"

From Inspired-Lua Wiki
Jump to navigation Jump to search
(Added page for platform.window:setBackgroundColor, and placed it in the platform.window category)
 
m (apparently I had '==' instead if '=' in the example…)
 
Line 20: Line 20:
  
 
<source lang="lua">
 
<source lang="lua">
platform.apilevel == '2.4'
+
platform.apilevel = '2.4'
 
platform.window:setBackgroundColor(12632256) --0xC0C0C0 (HTML silver)
 
platform.window:setBackgroundColor(12632256) --0xC0C0C0 (HTML silver)
 
</source>
 
</source>

Latest revision as of 14:59, 20 August 2018

platform.window:setBackgroundColor is a function that is part of platform.window.

This has been introduced in TI-Nspire OS 3.9 (Changes).

Sets the background color of the script's window.

Syntax

platform.window:setBackgroundColor(color)

Parameter Type Description
color
number A number representing the color of the background. Must be an integer between 0 and 16777216

NB: You can also use hexadecimal numbers instead of decimal ones for each of the arguments (from 0x000000 to 0xFFFFFF). The first two digits here represent the red, the third and fourth the green and the last two blue

Example

Below is an example that sets the background color of the window to HTML silver.

platform.apilevel = '2.4'
platform.window:setBackgroundColor(12632256) --0xC0C0C0 (HTML silver)