[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Color Text on CAD Buffer II



    It seems like a simple request: I want to output lines of text in different colors,
    depending on their importance to the user: red for critical, yellow for important, etc.

    However the color documentation is a maze of non-indexed, elliptical stuff about ALUs,
    char-alus, sc-fill-alus and so forth. I have played around for half an hour but without
    seeming to get anywhere, and certainly not with colored text. If I had time, I too could 
    become expert at it, but instead I ask the experts: anyone have a simple way to do
    multi- or vary-colored text, without blowing away the usual background/foreground colors?
    Thanks.

Try this:

(defun color-alu (alu r g b)
  (send color:color-screen :compute-color-alu alu r g b)
  )

Use the variable color:alu-x for the initial alu argument; r, g and b
args are numbers between 0 and 1 as desired.  This only works right if
you use the standard color maps (set up by default when you make your
color screen, window, etc.).

I have a complete example of the use of this functionality I can send if
you like; it's about 25k bytes long (10k for the basic color text part).
I haven't used it lately but it should still work.

Have fun!