Colour text. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Colour text.

chosen1_kingjichosen1_kingji Posts: 13Member
how to change the colour of text in output?

Comments

  • zibadianzibadian Posts: 6,349Member
    : how to change the colour of text in output?
    :
    In Text mode you can use TextColor() and TextBackground() from the Crt unit. In Graphics mode use the SetColor() and SetBackground() from the Graphs unit.
  • chosen1_kingjichosen1_kingji Posts: 13Member
    : : how to change the colour of text in output?
    : :
    : In Text mode you can use TextColor() and TextBackground() from the Crt unit. In Graphics mode use the SetColor() and SetBackground() from the Graphs unit.
    :
    for example

    if i want to display 'apple' in red
    what should i do?
  • zibadianzibadian Posts: 6,349Member
    : : : how to change the colour of text in output?
    : : :
    : : In Text mode you can use TextColor() and TextBackground() from the Crt unit. In Graphics mode use the SetColor() and SetBackground() from the Graphs unit.
    : :
    : for example
    :
    : if i want to display 'apple' in red
    : what should i do?
    :
    First you set the color using TextColor(). Then you write the word 'apple'. The two units have the color names defined as constants. So the complete code would be:
    [code]
    TextColor(Red);
    Write('Apple');
    [/code]
    The help files contain more info on the color constants and TextColor().
Sign In or Register to comment.