Announcement

Collapse
No announcement yet.

current color

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • current color

    if pbvScrnTxtAttr yields the forground color, what or
    how can I get the current background color?

    Thanks - Rick

    ------------------

  • #2
    The atribute allocates 4 bits for the foreground and 4 bit for the background color, so both are stored within that one value, thus:
    Code:
    cls
    color 15,4
    print "Foreground Color = " pbvscrntxtattr mod 16
    print "Background Color = " pbvscrntxtattr \ 16
    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Got It!
      Thanks - Rick

      ------------------

      Comment


      • #4
        If I recall correctly, the "blinking" attribute is treated as part
        of the foreground color in BASIC, but is actually the high bit of
        the background color as encoded for the display. So, this formula
        may need minor modification if you use blinking.

        ------------------
        Tom Hanlin
        PowerBASIC Staff

        Comment

        Working...
        X