Skip to content

Problems with conversion of Unsigned to RGB #118

Description

@mateuszbaran

I've accidentally been using Base.convert method from this package that converts Unsigned to RGB. This is type-unstable (which is easy to fix) but it also looks like type piracy, so this method likely shouldn't even be in this package. Here is that method:

function Base.convert(::Type{RGB}, h::Unsigned)
mask = 0x0000FF
RGB([(x & mask) / 0xFF for x in (h >> 16, h >> 8, h)]...)
end
. What do you think should be done about it?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions