Welcome to Coloria – the playful and powerful Arduino library for adding colors and formatting to your serial output and logs. Whether you're debugging or just want to add some flair to your projects, Coloria makes it easy!
- ANSI Color and Formatting Support:
- Foreground/Background Colors: Black, Red, Green, Yellow, Blue, Magenta, Cyan, White
- Bright Foreground/Background Colors: Bright Black, Bright Red, Bright Green, Bright Yellow, Bright Blue, Bright Magenta, Bright Cyan, Bright White
- Text Formatting:
Bold, Dim, Italic, Underline, Blink, Reverse, Hidden, Strikethrough
- HEX Color Code Support: Convert HEX color codes to ANSI escape sequences for custom colors.
- Text Alignment: Left, Center, Right
- Preset Combinations: Check documentation for the list of presets.
-
Download the Library:
-
Add the Library to Arduino IDE:
- Open Arduino IDE.
- Go to
Sketch
>Include Library
>Add .ZIP Library...
. - Select the downloaded ZIP file.
Here's a quick example to get you started:
#include <Arduino.h> // Include the Arduino library
#include <Coloria.h> // Include the Coloria library
void setup() {
Serial.begin(115200);
while (!Serial) {
// Wait for Serial to be ready
}
Coloria::println(Coloria::GREEN, Coloria::BOLD, "System setup complete.");
Coloria::println(Coloria::YELLOW, "This is a normal yellow text.");
Coloria::println(Coloria::RED, Coloria::UNDERLINE, "This is an underlined red text.");
Coloria::printlnHex("FF5733", "This is a text with HEX color #FF5733.");
Coloria::printlnHex("00FF00", "This text has a green background.", true);
Coloria::printlnAligned(Coloria::BLUE, "This text is centered.", "center", 40);
}
void loop() {
// Your loop implementation
}
The library features an example sketch available from the examples menu: Examples > Coloria > ColoriaSerialPrint
Coloria::println(Coloria::RED, "This is red text.");
Coloria::println(Coloria::GREEN, "This is green text.");
Coloria::println(Coloria::BLUE, "This is blue text.");
Coloria::println(Coloria::BRIGHT_RED, "This is bright red text.");
Coloria::println(Coloria::BRIGHT_GREEN, "This is bright green text.");
Coloria::println(Coloria::BRIGHT_BLUE, "This is bright blue text.");
Coloria::println(Coloria::RED, "This text has a red background.", true);
Coloria::printlnHex("FFFFFF", "This text has a white background.", true);
Coloria::printlnHex("FF5733", "This is text with HEX color #FF5733.");
Coloria::printlnHex("00FF00", "This text has a green background.", true);
// "true" indicates that the HEX code should be applied to the background.
Coloria::println(Coloria::BOLD, "This is bold text.");
Coloria::println(Coloria::UNDERLINE, "This is underlined text.");
Coloria::println(Coloria::ITALIC, "This is italic text.");
// note: Not all terminals support italic.
Coloria::printlnAligned(Coloria::BLUE, "This text is centered.", "center", 40);
Coloria::printlnAligned(Coloria::RED, "This text is right-aligned.", "right", 40);
Coloria::printlnAligned(Coloria::GREEN, "This text is left-aligned.", "left", 40);
We welcome contributions! Feel free to open issues or pull requests to help make Coloria even better.
- Fork the repository.
- Create a new branch:
git checkout -b my-new-feature
. - Make your changes and commit them:
git commit -m 'Fancy new feature'
. - Push to the branch:
git push origin my-new-feature
. - Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Have questions or feedback? Reach out to us:
- GitHub: https://github.com/4ngel2769/Coloria
- Email: 4ngel2769
Thank you for using Coloria! We hope it brings color and joy to your Arduino projects. Happy coding! 😊
Help us keep Coloria thriving by making a donation! Your support ensures continuous improvement and sustainability of the project.