Files
mcolor/main.cpp

46 lines
1.2 KiB
C++

#include <iostream>
#include <vector>
#include <functional>
#include <mcolor.h>
#include <Color4.hpp>
#include <Colors.hpp>
std::string fmt_color(const Color4& c)
{
return std::format("{}hue:{} rgb: {},{},{} hex: {}", c.ToEscapeCode(), c.ToHSV().h, c.r, c.g, c.b, c.ToHex());
}
int main()
{
#ifdef WIN32
mcolor::windowsSaneify();
#endif
// TODO: Demo Color Space Math Operations
// TODO: Demo Color Representation Conversions
// TODO: Demo Color output in console.
print_builtin_color_list();
mcolor::printAnsiColorTable();
mcolor::printRGBConsoleTest();
std::cout << "Color construction from hex codes:" << std::endl;
std::cout << fmt_color(Color4::FromHex("#FFFFFF")) << std::endl;
std::cout << fmt_color(Color4::FromHex("#F0F0F0")) << std::endl;
std::cout << fmt_color(Color4::FromHex("#0F0F0F")) << std::endl;
std::cout << fmt_color(Color4::FromHex("#00AAFF")) << std::endl;
for (float i = 0; i < 360; i+=10.f)
{
HSVA hsva {i, 1.f, 1.f};
Color4 c = Color4(hsva);
std::cout << std::format("{}hue:{} rgb: {},{},{} hex: {}", c.ToEscapeCode(), i, c.r, c.g, c.b, c.ToHex()) << std::endl;
}
return 0;
}