TI99 Environment

# CALL_COLOR

Syntax

CALL_COLOR(color-set,foreground-color,background-color)

Description

This function changes the foreground and background colors of all characters in color-set to foreground-color and background-color, respectively. The color-set parameter holds the character set to apply the color change. Valid color-set values: 1 to (endchar / 8 -3). A total of 8 consecutive ASCII characters comprise each color set (see the Color Set Table below). The foreground-color and background-color parameters hold the character's foreground and background colors respectively. Valid values: 1-16 (See the Available Colors Table below). The default foreground color is 2 - Black. The default background color is 1 - Transparent. Note 1: Call_Color() does not affect sprite colors. To change the foreground color of an existing sprite, use the Call_ColorSprite() function instead. To set the colors for new sprites, use the Call_Sprite() function. Note 2: To obtain the color set number of any character during a program, use the SetNumber() function. Note 3: To reset all character colors to the defaults, use the Call_Charset() function. * Characters using a transparent foreground OR background color, will show the current screen color through. Characters will turn invisible if both their background AND foreground colors are transparent.

Example Code

    Example 1:

    ` Marquee - Adapted from TI-99/4A Reference Guide
    RANDOMIZE TIMER()
    for s = 2 to numberofcolors
        CALL_COLOR(s,s,s)
    NEXT s
    Call_Hchar(7,3,64,28)
    Call_Hchar(16,3,64,28)
    Call_Vchar(7,2,64,10)
    Call_Vchar(7,31,64,10)
    do
       For a = 3 to 30
           c = int(rnd(119) + 40)
           Call_Vchar(8,a,c,4) : tiwait(5)
       NEXT a
       For a = 30 to 3 step -1
           c = int(rnd(119) + 40)
           Call_Vchar(12,a,c,4) : tiwait(5)
       NEXT a
    loop

    Example 2:

    ` Color Pattern - Program sample From Page II-80 of the TI-99/4a Ref Guide
      call_clear()
      for s = 2 to numberofcolors
        CALL_COLOR(s,s,s)
      next s
      do
        cslchr = 40
        for x = 8 to 22
            Call_Vchar(4,x,cslchr,15)
            Call_Hchar(x-4,8,cslchr,15) `: ti_sync()
            tiwait(50)
        inc cslchr,8
        next x
      loop

Go back to ...

TI99E Commands Menu
Main Menu

Copyright © Carlos Santiago Lebron - TI99 Environment 2020