FastLED 3.10.6
Loading...
Searching...
No Matches

◆ crgbJsonChannel()

optional< i64 > fl::anonymous_namespace{crgb_json.cpp.hpp}::crgbJsonChannel ( const json & value)

Definition at line 7 of file crgb_json.cpp.hpp.

7 {
8 if (!value.is_int() || value.is_bool()) {
9 return fl::nullopt;
10 }
11 const optional<i64> channel = value.as<i64>();
12 if (!channel || *channel < 0 || *channel > 255) {
13 return fl::nullopt;
14 }
15 return channel;
16}
constexpr int type_rank< T >::value
Optional< T > optional
Definition optional.h:16
constexpr nullopt_t nullopt
Definition optional.h:13
fl::i64 i64
Definition stdint.h:221

References crgbJsonChannel(), fl::FL_NO_EXCEPT, fl::nullopt, and fl::type_rank< T >::value.

Referenced by crgbJsonChannel(), and crgbJsonPixel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: