Transparent equivalent of given color

后端 未结 5 1406
温柔的废话
温柔的废话 2020-12-23 19:11

I\'ve had this a few times, so here goes: I\'m making some plots which hold curves with estimates of a parameter given a tuning parameter.

Typically, I also have SDs

5条回答
  •  心在旅途
    2020-12-23 19:57

    Converting valuable comment to answer:

    Use alpha from package scales - first argument is colour, second alpha (in 0-1 range).

    Or write function overt it:

    makeTransparent <- function(someColor, alpha=100) scales::alpha(someColor, alpha/100)
    

提交回复
热议问题