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
Hi! rgb(0, 0, 0) and rgba(0, 0, 0, 1) are equivalent, so the library opts to return the shorter string.
As for the object notation, the library doesn't really treat alpha specially at all since none of the operations that are performed on colors have to do with the alpha channel.
It's a design decision, really. I think it's been like that since old versions, I can't remember.
Hi there,
Why is it that object().alpha(1) does not return the alpha attr in the object() method?
color('#000000').alpha(0.5).object()
returns{alpha: 0.5, b: 0, g: 0, r: 0}
but
color('#000000').alpha(1).object()
returns{b: 0, g: 0, r: 0}
instead of{alpha: 1, b: 0, g: 0, r: 0}
Also wouldn't it make sense that
color({r: 0, g: 0, b: 0, alpha: 1}).string()
returnsrgba(0,0,0,1)
instead ofrgb(0,0,0)
The text was updated successfully, but these errors were encountered: