{{htmlmetatags>metatag-robots=() metatag-title=(COLOR | ugBASIC User Manual) metatag-keywords=(ugBASIC,Commodore 64,Commodore PLUS/4,ZX Spectrum) metatag-description=(Manual page for COLOR) metatag-media-og:image=(:ugbasic:logo-ugbasic-fb.png) metatag-og:title=(COLOR | ugBASIC User Manual) metatag-og:description=(Manual page for COLOR) }} ====== ugBASIC User Manual ====== ===== COLOR ===== ===== SYNTAX ===== COLOR index, shade COLOR border, background, foreground COLOR [border,][background] (if TSB is enabled) COLOR border COLOR ,foreground ==== PURPOSE ==== The ''COLOR'' command allows you to redefine the colors used by the graphics chipset, where this is possible. "Redefinition" means assigning one of the possible colors to specific registers called "palette registers". On some systems this is not possible at all, due to limitations of the chipset or the absence of registers: for this reason, in such cases the command is ignored. On other systems this corresponds to the modification of specific registers, to which one of the available colors is assigned. On others it is possible to assign certain shades, which therefore go beyond the number of available colors. Where it is possible to assign a shade, the value can range from ''0'' to the constant ''SHADES''. However, it may be more practical to use the ''RGB'' function, which allows you to calculate the shade starting from the color components (red, green and blue). If compatibility with Tuned Simons' BASIC is active, the semantics of the command changes, to directly indicate some specific components through a series of syntax variants. With the three-parameter variant, you can directly set the colors of the border, background and text. With the two-parameter variant, it will be possible to indicate the border and the background. With a single parameter, it will be possible to indicate the color of the border only. There is also the format where the first parameter is omitted, in which case the second indicates the color of the text. Note that the syntax with one or three parameters is automatically considered as pertaining to TSB. ==== EXAMPLE ==== COLOR 0, $fff ==== ABBREVIATION ==== Cr ==== AVAILABLE ON ==== * Dragon 32 * Commodore 128 (Zilog Z80) * Commodore 128 (MOS 8502) * Commodore 64 * Commodore VIC-20 * Atari (400/800) * Atari XL/XE * * Commodore 64+REU * Commodore PLUS/4 * Olivetti Prodest PC128 * Dragon 64 * Thomson MO5 * Amstrad CPC 664 * TRS-80 Color Computer 3 * TRS-80 Color Computer ==== SEE ALSO ==== [[COLOR BORDER]] [[SHADES (constant)]] [[RGB]] ==== ALIAS FOR ==== [[COLOUR]] ==== ANY PROBLEM? ==== If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please [[https://github.com/spotlessmind1975/ugbasic/issues/new?title=ISSUE ON COLOR|open an issue]] for this keyword on GitHub. Thank you!===== POWERED BY ===== [[:ugbasic:user:index|{{ :ugbasic:user:logo-ugbasic.png?nolink&600 |}}]]