feat(01-bmpmafia): deepfryer

This commit is contained in:
2025-02-06 11:20:31 +03:00
parent aac3bb56c8
commit e110d9afe2
6 changed files with 174 additions and 1 deletions

View File

@ -25,7 +25,15 @@ namespace bmp {
uint32_t colorsUsed;
uint32_t colorsImportant;
};
struct BMPColorHeader {
uint32_t red;
uint32_t green;
uint32_t blue;
uint32_t alpha;
uint32_t colorSpaceType;
uint32_t unused[16];
};
}
#pragma pack(pop)
#endif

View File

@ -0,0 +1,24 @@
#ifndef RAINBOW_HPP
#define RAINBOW_HPP
#include <ostream>
namespace rainbow {
void print(std::ostream & out, std::string s) {
std::string colors[7] = {
"\033[38;2;210;15;57m",
"\033[38;2;254;100;11m",
"\033[38;2;223;142;29m",
"\033[38;2;64;160;43m",
"\033[38;2;4;165;229m",
"\033[38;2;30;102;245m",
"\033[38;2;136;57;239m"
};
for (int i = 0; i < s.length(); i++)
{
out << colors[i % 7] << s[i] << "\033[0m";
}
}
}
#endif