extract-rgb

awgrover/adafruitneopixel/extract-rgb

Get red, green, blue elements of rgb color
extract-rgb
@/extract-rgb
Get red, green, blue elements of rgb color
rgb@/rgb-color
extract-rgb
red
green
blue
rgb
bluenumber
greennumber
rednumber
To use the node in your project you should have the awgrover/adafruitneopixel library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    auto rgb = getValue<input_rgb>(ctx);
    // only emit changes
    if (rgb->red != getValue<output_red>(ctx)) emitValue<output_red>(ctx, rgb->red);
    if (rgb->green != getValue<output_green>(ctx))emitValue<output_green>(ctx, rgb->green);
    if (rgb->blue != getValue<output_blue>(ctx))emitValue<output_blue>(ctx, rgb->blue);
}