You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Indeed the image.color.Color interface is defined as
typeColorinterface {
// RGBA returns the alpha-premultiplied red, green, blue and alpha values// for the color. Each value ranges within [0, 0xffff], but is represented// by a uint32 so that multiplying by a blend factor up to 0xffff will not// overflow.//// An alpha-premultiplied color component c has been scaled by alpha (a),// so has valid values 0 <= c <= a.RGBA() (r, g, b, auint32)
}
therefore it expects that RGBA() returns a value in [0, 0xffff].
Even though we should implement the interface correctly, I still think it would be useful to be able to access the uint8 values, maybe with a RGBA8() function?
The text was updated successfully, but these errors were encountered:
Right now the
color.RBGA()
function is implemented astherefore the values returned are in the interval
[0,0xff]
.This behavior is different from the one of
image.color.RGBA.RGBA()
which (as of go 1.23) implements it asIndeed the
image.color.Color
interface is defined astherefore it expects that
RGBA()
returns a value in[0, 0xffff]
.Even though we should implement the interface correctly, I still think it would be useful to be able to access the
uint8
values, maybe with aRGBA8()
function?The text was updated successfully, but these errors were encountered: