COLOR()

From Liberty BASIC Family
Jump to navigation Jump to search
Not supported in Just BASIC Not supported in Liberty BASIC Not supported in Liberty BASIC 5 Supported in Run BASIC

Description

Use the COLOR statement to set the drawing color in a graphic object. The default drawing color is black.

Syntax

Named Color

  1. #handle COLOR("green")

RGB Color

  1. #handle COLOR("255, 128, 0")

Hints

The list of named Run BASIC colors:
  • black
  • blue
  • brown
  • chartreuse
  • cyan
  • darkCyan
  • darkGray
  • darkGreen
  • darkMagenta
  • darkRed
  • gray
  • green
  • lightCyan
  • lightGray
  • lightYellow
  • magenta
  • navy
  • olive
  • orange
  • orchid
  • paleGreen
  • pink
  • purple
  • red
  • royalBlue
  • salmon
  • springGreen
  • veryDarkGray
  • veryLightGray
  • white
  • yellow

Example

'create a graphic object
graphic #g, 300, 300

'set the drawing color to be salmon
#g color("salmon")

'place the drawing pen at 10,10
#g place(10,10)

'draw a box
#g box(290, 290)

'add graphic to web page
render #g
'create a graphic object
graphic #g, 300, 300

'set the drawing color to be 233,88,125
#g color(233,88,125)

'place the drawing pen at 10,10
#g place(10,10)

'draw a box
#g box(290, 290)

'add graphic to web page
render #g

Useful Procedures

' Place a useful function or sub using this keyword here