MCPcopy Create free account
hub / github.com/FastLED/FastLED / to_uint8

Function to_uint8

src/fl/gfx/splat.cpp.hpp:8–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace fl {
7
8static u8 to_uint8(float f) {
9 // convert to [0..255] range
10 u8 i = static_cast<u8>(f * 255.0f + .5f);
11 return fl::min(i, 255);
12}
13
14Tile2x2_u8 splat(vec2f xy) {
15 // 1) collect values.

Callers 1

splatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected