Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/adi3120/Fazen2d/llms.txt

Use this file to discover all available pages before exploring further.

Fazen2d colors are Windows console attribute short values that control character and cell appearance. The ConsoleColor enum provides named constants for common foreground and background colors built from the Windows FOREGROUND_* and BACKGROUND_* flag macros; the Color class combines a foreground and background constant into a single manageable object.
#include "include/headers/Colors.h"  // included automatically via Fazen.h

ConsoleColor Enum

All constants are defined as members of the ConsoleColor enum and can be used wherever a short color value is expected.
ConstantValueMeaning
redFFOREGROUND_RED | FOREGROUND_INTENSITYBright red foreground
redBBACKGROUND_RED | BACKGROUND_INTENSITYBright red background
blueFFOREGROUND_BLUE | FOREGROUND_INTENSITYBright blue foreground
blueBBACKGROUND_BLUE | BACKGROUND_INTENSITYBright blue background
greenFFOREGROUND_GREEN | FOREGROUND_INTENSITYBright green foreground
greenBBACKGROUND_GREEN | BACKGROUND_INTENSITYBright green background
dmagentaF0x0005Dark magenta foreground
magentaF0x000DBright magenta foreground
yellowF0x000EYellow foreground
dyellowF0x0006Dark yellow foreground
dredF0x0004Dark red foreground
greyF0x0008Grey foreground
dgreenF0x0002Dark green foreground
whiteF0x000FWhite foreground
whiteBBACKGROUND_BLUE | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_INTENSITYWhite background

Color Class

The Color class stores a foreground color, a background color, and a combined value computed as fgColor | bgColor. The constructor initializes all three fields.

Constructor

Color(short fgColor = 0, short bgColor = whiteB);
Creates a Color with the given foreground and background. The combined value is set to fgColor | bgColor at construction time. If no arguments are passed, the foreground defaults to 0 (no foreground attribute) and the background defaults to whiteB.

Methods

SignatureReturnsDescription
setFgColor(short fgColor)voidSets the stored foreground color field
getFgColor()shortReturns the stored foreground color
setBgColor(short bgColor)voidSets the stored background color field
getBgColor()shortReturns the stored background color
setValue(short value)voidOverrides the combined attribute directly
getValue()shortReturns the combined attribute (fgColor | bgColor or the overridden value)
Pass getValue() to any shape’s color parameter to apply the full foreground-and-background styling.

Combining Colors

Foreground and background constants can be combined with the bitwise OR operator, either directly or through the Color class.
// Red text on blue background — direct bitwise OR
short combined = redF | blueB;
Text label(5, 5, L"Alert!", combined);

// Equivalent approach using the Color class
Color c(redF, blueB);
Text label2(5, 7, L"Alert!", c.getValue());
Constants suffixed F set the character (foreground) color; constants suffixed B set the cell background color. Pass background constants to game.graphics.background() and foreground constants (or combined values) as the color parameter of shapes such as Box, Circle, Text, and Point.

Build docs developers (and LLMs) love