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
I think it would be useful to add a function that takes a color.Color and returns a tcell.Color. Although it isn't too difficult to implement (just take the RGB values from color.Color and do some slight conversion), it adds extra steps to the user that can probably be done by this library.
It can also be confusing for users trying to manually convert, since tcell.NewRGBColor takes type int32 but only accepts the range 0-255, while image/color.Color returns type uint32. This can make the user think they can simply convert the uint32 value to int32, but this isn't necessarily true. For example, in a project I'm working on, I thought I could do a simple int32(uint32Value), but found out that I also had to bit shift the uint32 values to make it in the range 0-255.
Apologies if this already exists, but I didn't see it anywhere.
The text was updated successfully, but these errors were encountered:
I think it would be useful to add a function that takes a
color.Color
and returns atcell.Color
. Although it isn't too difficult to implement (just take the RGB values fromcolor.Color
and do some slight conversion), it adds extra steps to the user that can probably be done by this library.It can also be confusing for users trying to manually convert, since
tcell.NewRGBColor
takes typeint32
but only accepts the range 0-255, whileimage/color.Color
returns typeuint32
. This can make the user think they can simply convert theuint32
value toint32
, but this isn't necessarily true. For example, in a project I'm working on, I thought I could do a simpleint32(uint32Value)
, but found out that I also had to bit shift theuint32
values to make it in the range 0-255.Apologies if this already exists, but I didn't see it anywhere.
The text was updated successfully, but these errors were encountered: