Skip to content

isDark() returns true regardless of color passed #3

Open
@stam66

Description

@stam66

using isDark() or isLight() fails to discern light or dark colours.

These are based on getBrightness()

getBrightness calls private function _fixRGB pRGB

private function _fixRGB pRGB returns text triplet

getBrigthness pRGB expects an array but calls _fixRGB which returns a triplet!

So then in getBrightness fails because tRBG is a text triplet, but getBrightness uses this as an array:
return (tRGB["r"]* 299 + tRGB["g"]* 587 + tRGB["b"]* 114) / 1000

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