The Sri Lanka Nature Inspired Color Palettes (nic) package contains a wide range of color palettes that you can use for your visualizations. All the color palettes are inspired by the natural color palettes in Sri Lanka. Color palettes are mainly divided to three categories based on their capability to show case colors.
In this tutorial we will be exploring all of the color palettes
available within the nic
package. The names of the color
palettes available within the nic
package are as
follows.
names(nic_palettes)
#> [1] "applecroton_2" "coleusa_2" "coleusb_3" "coleus_density_7"
#> [5] "wishbone_3" "buttercup_12" "buttercup_8" "ixora_12"
#> [9] "ixora_8" "moss_rose_5" "orchid_12" "orchid_8"
#> [13] "squarestem_5" "papaya_11" "kandyan_dancer_6"
penguins %>%
drop_na() %>%
ggplot(aes(x = bill_length_mm,y = bill_depth_mm,color=body_mass_g))+
geom_point()+
scale_color_gradientn(colors = nic_palette("orchid_12",12))+
labs(x = "Length of bill in milimetres",y = "Depth of bill in milimetres",color = "Body mass in grams")+
theme(legend.position = "top")
set.seed(42)
tibble(Date = seq.Date(from = as.Date("2021-1-1"),
to = as.Date("2021-12-31"),by = "day"),
Returns = as.numeric(arima.sim(n = 365,list(ar = c(0.501))))) %>%
ggplot(aes(x = Date,y = Returns,color = Returns))+
geom_line()+
scale_color_gradientn(colors = nic_palette("kandyan_dancer_6"))+
theme(legend.position = "bottom")