4#include "../core/color.hpp"
5#include "../core/coords.hpp"
6#include "../core/size.hpp"
18 if (coords.
x <= size.
x / 2) {
25 float gray = r * 0.299 + g * 0.587 + b * 0.113;
26 return color(gray, gray, gray);
constexpr color_t color(const float red, const float green, const float blue)
Convert normalized color components into an RGB565 value.
Definition color.hpp:31
void colorComponents(color_t color, float &red, float &green, float &blue)
Split an RGB565 color value into normalized components.
uint16_t color_t
An RGB565 color value. 5 bits red, 6 bits green, 5 bits blue.
Definition color.hpp:13
color_t halfGrayscaleV(color_t pixel, const Coords &coords, const Size &size)
A pixel shader that converts the right half of an image to grayscale.
Definition half_grayscale_v.hpp:17
A struct for storing the pixel coordinates of various UI elements.
Definition coords.hpp:17
coord_t x
The horizontal coordinate.
Definition coords.hpp:19
A struct that holds the number of pixels that a widget would take up on the screen.
Definition size.hpp:17
uisize_t x
The width of the widget.
Definition size.hpp:19