Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Flipper 6.0 Help File - <b>colr_table()</b> c_exam07 http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
COLR_TABLE()                                                       C_EXAM07
   Sets the color translation between the screen and the printer.

   Syntax
         nColor = COLR_TABLE(nColorTableNum [,nColor])

   Arguments
         aColorTableNum  Number of the element in the 16 element color table.
                         (0-15)
         OPTIONAL PARAMETERS
          nColor     Color number.

   Returns
          nColor     Color number.

   Description
         A 16 element array of color numbers is used to translate the
         colors sent by Flipper into the color or shade for the device,
         similar to SET_PAL(). Many color printers only have 7 colors (8
         including white), so you need to create a mapping between the (up
         to 16) colors on the screen and the colors available from the
         printer.

         As the color of a pixel from the screen is sent to the printer, the
         driver uses the pixel's value as an index into this array and uses
         that value as the printer color to use.

         The following array shows the values that are used for the default
         color table for the Epson LQ 2500 printer:
                 +---------------------------------------+
                 |Epson LQ 2500 printer color translation|
                 ----------------------------------------|
                 |  0  | Black       |  4  | Yellow      |
                 |  1  | Magenta     |  5  | Red         |
                 |  2  | Cyan        |  6  | Green       |
                 |  3  | Violet      |  7  | White       |
                 +---------------------------------------+
         As we've set it up, there are a few apparent anomolies. First, note
         that printer color #7 is used by us to not print anything and
         therefore it is white, the color of the paper. We've assigned that
         value to black pixel color 0 because black is the most common
         background color in graphics displays. We recommend you set a
         printer color #7 to  whatever the background color is for your
         application. We've also translated white (pixel values 7 and 15) to
         the black color number. You may want something else, but this should
         be good for most circumstances.

         This table is different, however, for the Hewlett Packard Paintjet
         and PaintJet XL. It is also different in the way that it works.
         The color numbers actually are pointers to values defined in
         SHAD_TABLE(). Each number represents a different shading pattern
         set by SHAD_TABLE() (see the table under SHAD_TABLE()). There are
         default colors, however, and these can be used in the same way as
         described above for the other printers.

         Of course the mapping here assumes the default EGA/VGA palette. If
         your program has reprogrammed the palette, you should consider using
         new values to match the new colors associated with the pixel numbers.

See Also: PRT_COLORS() PRT_OPTS() SHAD_TABLE()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson