Skip to content

Neopixel White value is ignored when RGB set to 0 #32

Closed
@EricGallimore

Description

@EricGallimore

If you want to make an RGBW pixel white by setting a white value like this:
neopixels.fill((0,0,0,255))

it will instead set the W value to 0. The offending logic is here:

        # If all components are the same and we have a white pixel then use it
        # instead of the individual components.
        if self._bpp == 4 and r == g == b:
            w = r
            r = 0
            g = 0
            b = 0

Perhaps this should change, such that the W pixel value is only inferred from RGB values if the W value is 0? The if statement could become
if self._bpp ==4 and r==g==b and w==0:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions