====== Using Colors ====== The [[addtable_set_printer_message|ADDTABLE]], [[fillstyle_set_printer_message|FILLSTYLE]], [[font_set_printer_message|FONT]], [[fontheadfoot_set_printer_message|FONTHEADFOOT]], and [[linestyle_set_printer_message|LINESTYLE]] messages have a color parameter. This color parameter must contain a valid COLORREF value, which is passed to the printer engine. The formula for calculating a COLORREF is: color = 0 color += red color += green * 256 color += blue * 65536 Where red is the red value from 0 to 255, green is the green value from 0 to 255, and blue is the blue value from 0 to 255. Black is equal to 0 and white is equal to 16843008. The setup program for the OIPI installed a function called [[rgb|RGB()]] that can be called from a Basic+ program to perform the conversion to the COLORREF format. There are three parameters for the [[rgb|RGB()]] function: red, green, and blue. These parameters must have values between 0 and 255. The value for each color specifies how much of each color component is contained in the COLORREF. Another method of obtaining a valid COLORREF is to use the Basic+ [[utility|UTILITY()]] function. The common dialog box for Colors can be displayed with the first parameter of UTILITY set to [[choosecolor_service|CHOOSECOLOR.]] The [[oiprint_equates|OIPRINT_EQUATES]] $INSERT record contains constants for common color codes. \\