ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
brightness.h
Go to the documentation of this file.
1#pragma once
2
3#include <cmath>
4#include <cstdint>
5
7
8// A light brightness from 0 to 1, scaled into [min_brightness, max_brightness]
9inline uint8_t scale_brightness(float brightness, uint8_t min_brightness, uint8_t max_brightness) {
10 return min_brightness + static_cast<uint8_t>(roundf(brightness * (max_brightness - min_brightness)));
11}
12
13} // namespace esphome::mipi_dsi
uint8_t scale_brightness(float brightness, uint8_t min_brightness, uint8_t max_brightness)
Definition brightness.h:9