thomasp85 / farver

High Performance Colourspace Manipulation in R
https://farver.data-imaginist.com
Other
125 stars 14 forks source link

`encode_native("transparent")` is `-1L` instead of `16777215L` #47

Open trevorld opened 1 month ago

trevorld commented 1 month ago
> library("farver")
> encode_native("transparent")
[1] -1
> encode_native("#FFFFFF00")
[1] 16777215
> encode_native("#FFFFFF00") |> decode_native()
[1] "#FFFFFF00"
> encode_native("transparent") |> decode_native()
[1] "#FFFFFF"
> encode_native("white") |> decode_native()
[1] "#FFFFFF"
> col2rgb(c("transparent", "#FFFFFF00", "white"),  
          alpha = TRUE)
      [,1] [,2] [,3]
red    255  255  255
green  255  255  255
blue   255  255  255
alpha    0    0  255
> sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

time zone: America/Los_Angeles
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] farver_2.1.2

loaded via a namespace (and not attached):
[1] compiler_4.4.0