Skip to content

Problems with conversion of Unsigned to RGB #118

@mateuszbaran

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions