The 'other' TFT.xxx.COL colours.

Place code snippets and demo code here
Post Reply
AndyGadget
Posts: 63
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 24 times
Been thanked: 54 times

The 'other' TFT.xxx.COL colours.

Post by AndyGadget »

Just a simple demo of the named colours available for the TFT command.
I've also added a couple of suggestions for improved colour codes (RGB565 format) which look more representative on my ILI9341 at least.
(Note : in the help file, 'SYBLUE' should be 'SKYBLUE'.)

Code: [Local Link Removed for Guests]

TFT.INIT 1
TFT.FILL 0
TFT.TEXT.FONT 4
TFT.BRIGHTNESS 255
TFT.TEXT.POS 1,20

do
  TFT.TEXT.COL WHITE
  TFT.PRINT "WHITE"
  TFT.TEXT.COL LIGHTGREY
  TFT.PRINT "LIGHTGREY"
  TFT.TEXT.COL SILVER
  TFT.PRINT "SILVER"
  TFT.TEXT.COL DARKGREY
  TFT.PRINT "DARKGREY"
  
  gosub ClrScn
  TFT.TEXT.COL SKYBLUE
  TFT.PRINT "SKYBLUE"
  TFT.TEXT.COL CYAN
  TFT.PRINT "CYAN"
  TFT.TEXT.COL DARKCYAN
  TFT.PRINT "DARKCYAN"
  TFT.TEXT.COL BLUE
  TFT.PRINT "BLUE"
  TFT.TEXT.COL NAVY
  TFT.PRINT "NAVY"
  
  gosub ClrScn
  TFT.TEXT.COL GOLD
  TFT.PRINT "GOLD"
  TFT.TEXT.COL &HFD26
  TFT.PRINT "NEWGOLD"
  TFT.TEXT.COL YELLOW
  TFT.PRINT "YELLOW"
  TFT.TEXT.COL GREENYELLOW
  TFT.PRINT "GREENYELLOW"
  TFT.TEXT.COL OLIVE
  TFT.PRINT "OLIVE"
  TFT.TEXT.COL DARKGREEN
  TFT.PRINT "DARKGREEN"
  TFT.TEXT.COL GREEN
  TFT.PRINT "GREEN"

  gosub ClrScn
  TFT.TEXT.COL RED
  TFT.PRINT "RED"
  TFT.TEXT.COL MAROON
  TFT.PRINT "MAROON"
  TFT.TEXT.COL PURPLE
  TFT.PRINT "PURPLE"
  TFT.TEXT.COL VIOLET
  TFT.PRINT "VIOLET"
  TFT.TEXT.COL MAGENTA
  TFT.PRINT "MAGENTA"
  
  gosub ClrScn
  TFT.TEXT.COL ORANGE
  TFT.PRINT "ORANGE"
  TFT.TEXT.COL &HFBE0
  TFT.PRINT "NEWORANGE"
  TFT.TEXT.COL PINK
  TFT.PRINT "PINK"
  TFT.TEXT.COL &HFFB2F
  TFT.PRINT "NEWPINK"
  TFT.TEXT.COL BROWN
  TFT.PRINT "BROWN"
  gosub ClrScn 
loop

ClrScn:
pause 8000
TFT.FILL 0
TFT.TEXT.POS 1,20
return
Post Reply