Skip to content

setting color, bgColor or spotColor changes the image data #3

@maraoz

Description

@maraoz

Expected behavior:

Setting color, bgColor or spotColor should only change the colors and not the pattern

Rationale

this way, one can customize the blockies palette, while preserving the same pattern as expected (appearing in etherscan, metamask, etc)

Analysis

I think these lines are responsible:
https://github.com/AugurProject/react-blockies/blob/master/src/main.jsx#L141

When you set any of those 3, the createColor is not called for that line, which leads to a different amount of rand() calls, which, changes the pattern result (image data).

A very simple fix would be to call createColor even if color, bgColor or spotColor are set. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions