| 22 | /// Generic: for fixed-point types (those with .to_int()) |
| 23 | template<typename T> |
| 24 | inline fl::u8 coordToU8(T alpha) { |
| 25 | return (fl::u8)fl::clamp((alpha * T(255.0f) + T(0.5f)).to_int(), 0, 255); |
| 26 | } |
| 27 | |
| 28 | // Specialization for float |
| 29 | template<> |