Vectorised in both colour and alpha.
Arguments
- colour
colour
- alpha
new alpha level in [0,1]. If alpha is
NA
, existing alpha values are preserved.
Examples
alpha("red", 0.1)
#> [1] "#FF00001A"
alpha(colours(), 0.5)
#> [1] "#FFFFFF80" "#F0F8FF80" "#FAEBD780" "#FFEFDB80" "#EEDFCC80"
#> [6] "#CDC0B080" "#8B837880" "#7FFFD480" "#7FFFD480" "#76EEC680"
#> [11] "#66CDAA80" "#458B7480" "#F0FFFF80" "#F0FFFF80" "#E0EEEE80"
#> [16] "#C1CDCD80" "#838B8B80" "#F5F5DC80" "#FFE4C480" "#FFE4C480"
#> [21] "#EED5B780" "#CDB79E80" "#8B7D6B80" "#00000080" "#FFEBCD80"
#> [26] "#0000FF80" "#0000FF80" "#0000EE80" "#0000CD80" "#00008B80"
#> [31] "#8A2BE280" "#A52A2A80" "#FF404080" "#EE3B3B80" "#CD333380"
#> [36] "#8B232380" "#DEB88780" "#FFD39B80" "#EEC59180" "#CDAA7D80"
#> [41] "#8B735580" "#5F9EA080" "#98F5FF80" "#8EE5EE80" "#7AC5CD80"
#> [46] "#53868B80" "#7FFF0080" "#7FFF0080" "#76EE0080" "#66CD0080"
#> [51] "#458B0080" "#D2691E80" "#FF7F2480" "#EE762180" "#CD661D80"
#> [56] "#8B451380" "#FF7F5080" "#FF725680" "#EE6A5080" "#CD5B4580"
#> [61] "#8B3E2F80" "#6495ED80" "#FFF8DC80" "#FFF8DC80" "#EEE8CD80"
#> [66] "#CDC8B180" "#8B887880" "#00FFFF80" "#00FFFF80" "#00EEEE80"
#> [71] "#00CDCD80" "#008B8B80" "#00008B80" "#008B8B80" "#B8860B80"
#> [76] "#FFB90F80" "#EEAD0E80" "#CD950C80" "#8B650880" "#A9A9A980"
#> [81] "#00640080" "#A9A9A980" "#BDB76B80" "#8B008B80" "#556B2F80"
#> [86] "#CAFF7080" "#BCEE6880" "#A2CD5A80" "#6E8B3D80" "#FF8C0080"
#> [91] "#FF7F0080" "#EE760080" "#CD660080" "#8B450080" "#9932CC80"
#> [96] "#BF3EFF80" "#B23AEE80" "#9A32CD80" "#68228B80" "#8B000080"
#> [101] "#E9967A80" "#8FBC8F80" "#C1FFC180" "#B4EEB480" "#9BCD9B80"
#> [106] "#698B6980" "#483D8B80" "#2F4F4F80" "#97FFFF80" "#8DEEEE80"
#> [111] "#79CDCD80" "#528B8B80" "#2F4F4F80" "#00CED180" "#9400D380"
#> [116] "#FF149380" "#FF149380" "#EE128980" "#CD107680" "#8B0A5080"
#> [121] "#00BFFF80" "#00BFFF80" "#00B2EE80" "#009ACD80" "#00688B80"
#> [126] "#69696980" "#69696980" "#1E90FF80" "#1E90FF80" "#1C86EE80"
#> [131] "#1874CD80" "#104E8B80" "#B2222280" "#FF303080" "#EE2C2C80"
#> [136] "#CD262680" "#8B1A1A80" "#FFFAF080" "#228B2280" "#DCDCDC80"
#> [141] "#F8F8FF80" "#FFD70080" "#FFD70080" "#EEC90080" "#CDAD0080"
#> [146] "#8B750080" "#DAA52080" "#FFC12580" "#EEB42280" "#CD9B1D80"
#> [151] "#8B691480" "#BEBEBE80" "#00000080" "#03030380" "#05050580"
#> [156] "#08080880" "#0A0A0A80" "#0D0D0D80" "#0F0F0F80" "#12121280"
#> [161] "#14141480" "#17171780" "#1A1A1A80" "#1C1C1C80" "#1F1F1F80"
#> [166] "#21212180" "#24242480" "#26262680" "#29292980" "#2B2B2B80"
#> [171] "#2E2E2E80" "#30303080" "#33333380" "#36363680" "#38383880"
#> [176] "#3B3B3B80" "#3D3D3D80" "#40404080" "#42424280" "#45454580"
#> [181] "#47474780" "#4A4A4A80" "#4D4D4D80" "#4F4F4F80" "#52525280"
#> [186] "#54545480" "#57575780" "#59595980" "#5C5C5C80" "#5E5E5E80"
#> [191] "#61616180" "#63636380" "#66666680" "#69696980" "#6B6B6B80"
#> [196] "#6E6E6E80" "#70707080" "#73737380" "#75757580" "#78787880"
#> [201] "#7A7A7A80" "#7D7D7D80" "#7F7F7F80" "#82828280" "#85858580"
#> [206] "#87878780" "#8A8A8A80" "#8C8C8C80" "#8F8F8F80" "#91919180"
#> [211] "#94949480" "#96969680" "#99999980" "#9C9C9C80" "#9E9E9E80"
#> [216] "#A1A1A180" "#A3A3A380" "#A6A6A680" "#A8A8A880" "#ABABAB80"
#> [221] "#ADADAD80" "#B0B0B080" "#B3B3B380" "#B5B5B580" "#B8B8B880"
#> [226] "#BABABA80" "#BDBDBD80" "#BFBFBF80" "#C2C2C280" "#C4C4C480"
#> [231] "#C7C7C780" "#C9C9C980" "#CCCCCC80" "#CFCFCF80" "#D1D1D180"
#> [236] "#D4D4D480" "#D6D6D680" "#D9D9D980" "#DBDBDB80" "#DEDEDE80"
#> [241] "#E0E0E080" "#E3E3E380" "#E5E5E580" "#E8E8E880" "#EBEBEB80"
#> [246] "#EDEDED80" "#F0F0F080" "#F2F2F280" "#F5F5F580" "#F7F7F780"
#> [251] "#FAFAFA80" "#FCFCFC80" "#FFFFFF80" "#00FF0080" "#00FF0080"
#> [256] "#00EE0080" "#00CD0080" "#008B0080" "#ADFF2F80" "#BEBEBE80"
#> [261] "#00000080" "#03030380" "#05050580" "#08080880" "#0A0A0A80"
#> [266] "#0D0D0D80" "#0F0F0F80" "#12121280" "#14141480" "#17171780"
#> [271] "#1A1A1A80" "#1C1C1C80" "#1F1F1F80" "#21212180" "#24242480"
#> [276] "#26262680" "#29292980" "#2B2B2B80" "#2E2E2E80" "#30303080"
#> [281] "#33333380" "#36363680" "#38383880" "#3B3B3B80" "#3D3D3D80"
#> [286] "#40404080" "#42424280" "#45454580" "#47474780" "#4A4A4A80"
#> [291] "#4D4D4D80" "#4F4F4F80" "#52525280" "#54545480" "#57575780"
#> [296] "#59595980" "#5C5C5C80" "#5E5E5E80" "#61616180" "#63636380"
#> [301] "#66666680" "#69696980" "#6B6B6B80" "#6E6E6E80" "#70707080"
#> [306] "#73737380" "#75757580" "#78787880" "#7A7A7A80" "#7D7D7D80"
#> [311] "#7F7F7F80" "#82828280" "#85858580" "#87878780" "#8A8A8A80"
#> [316] "#8C8C8C80" "#8F8F8F80" "#91919180" "#94949480" "#96969680"
#> [321] "#99999980" "#9C9C9C80" "#9E9E9E80" "#A1A1A180" "#A3A3A380"
#> [326] "#A6A6A680" "#A8A8A880" "#ABABAB80" "#ADADAD80" "#B0B0B080"
#> [331] "#B3B3B380" "#B5B5B580" "#B8B8B880" "#BABABA80" "#BDBDBD80"
#> [336] "#BFBFBF80" "#C2C2C280" "#C4C4C480" "#C7C7C780" "#C9C9C980"
#> [341] "#CCCCCC80" "#CFCFCF80" "#D1D1D180" "#D4D4D480" "#D6D6D680"
#> [346] "#D9D9D980" "#DBDBDB80" "#DEDEDE80" "#E0E0E080" "#E3E3E380"
#> [351] "#E5E5E580" "#E8E8E880" "#EBEBEB80" "#EDEDED80" "#F0F0F080"
#> [356] "#F2F2F280" "#F5F5F580" "#F7F7F780" "#FAFAFA80" "#FCFCFC80"
#> [361] "#FFFFFF80" "#F0FFF080" "#F0FFF080" "#E0EEE080" "#C1CDC180"
#> [366] "#838B8380" "#FF69B480" "#FF6EB480" "#EE6AA780" "#CD609080"
#> [371] "#8B3A6280" "#CD5C5C80" "#FF6A6A80" "#EE636380" "#CD555580"
#> [376] "#8B3A3A80" "#FFFFF080" "#FFFFF080" "#EEEEE080" "#CDCDC180"
#> [381] "#8B8B8380" "#F0E68C80" "#FFF68F80" "#EEE68580" "#CDC67380"
#> [386] "#8B864E80" "#E6E6FA80" "#FFF0F580" "#FFF0F580" "#EEE0E580"
#> [391] "#CDC1C580" "#8B838680" "#7CFC0080" "#FFFACD80" "#FFFACD80"
#> [396] "#EEE9BF80" "#CDC9A580" "#8B897080" "#ADD8E680" "#BFEFFF80"
#> [401] "#B2DFEE80" "#9AC0CD80" "#68838B80" "#F0808080" "#E0FFFF80"
#> [406] "#E0FFFF80" "#D1EEEE80" "#B4CDCD80" "#7A8B8B80" "#EEDD8280"
#> [411] "#FFEC8B80" "#EEDC8280" "#CDBE7080" "#8B814C80" "#FAFAD280"
#> [416] "#D3D3D380" "#90EE9080" "#D3D3D380" "#FFB6C180" "#FFAEB980"
#> [421] "#EEA2AD80" "#CD8C9580" "#8B5F6580" "#FFA07A80" "#FFA07A80"
#> [426] "#EE957280" "#CD816280" "#8B574280" "#20B2AA80" "#87CEFA80"
#> [431] "#B0E2FF80" "#A4D3EE80" "#8DB6CD80" "#607B8B80" "#8470FF80"
#> [436] "#77889980" "#77889980" "#B0C4DE80" "#CAE1FF80" "#BCD2EE80"
#> [441] "#A2B5CD80" "#6E7B8B80" "#FFFFE080" "#FFFFE080" "#EEEED180"
#> [446] "#CDCDB480" "#8B8B7A80" "#32CD3280" "#FAF0E680" "#FF00FF80"
#> [451] "#FF00FF80" "#EE00EE80" "#CD00CD80" "#8B008B80" "#B0306080"
#> [456] "#FF34B380" "#EE30A780" "#CD299080" "#8B1C6280" "#66CDAA80"
#> [461] "#0000CD80" "#BA55D380" "#E066FF80" "#D15FEE80" "#B452CD80"
#> [466] "#7A378B80" "#9370DB80" "#AB82FF80" "#9F79EE80" "#8968CD80"
#> [471] "#5D478B80" "#3CB37180" "#7B68EE80" "#00FA9A80" "#48D1CC80"
#> [476] "#C7158580" "#19197080" "#F5FFFA80" "#FFE4E180" "#FFE4E180"
#> [481] "#EED5D280" "#CDB7B580" "#8B7D7B80" "#FFE4B580" "#FFDEAD80"
#> [486] "#FFDEAD80" "#EECFA180" "#CDB38B80" "#8B795E80" "#00008080"
#> [491] "#00008080" "#FDF5E680" "#6B8E2380" "#C0FF3E80" "#B3EE3A80"
#> [496] "#9ACD3280" "#698B2280" "#FFA50080" "#FFA50080" "#EE9A0080"
#> [501] "#CD850080" "#8B5A0080" "#FF450080" "#FF450080" "#EE400080"
#> [506] "#CD370080" "#8B250080" "#DA70D680" "#FF83FA80" "#EE7AE980"
#> [511] "#CD69C980" "#8B478980" "#EEE8AA80" "#98FB9880" "#9AFF9A80"
#> [516] "#90EE9080" "#7CCD7C80" "#548B5480" "#AFEEEE80" "#BBFFFF80"
#> [521] "#AEEEEE80" "#96CDCD80" "#668B8B80" "#DB709380" "#FF82AB80"
#> [526] "#EE799F80" "#CD688980" "#8B475D80" "#FFEFD580" "#FFDAB980"
#> [531] "#FFDAB980" "#EECBAD80" "#CDAF9580" "#8B776580" "#CD853F80"
#> [536] "#FFC0CB80" "#FFB5C580" "#EEA9B880" "#CD919E80" "#8B636C80"
#> [541] "#DDA0DD80" "#FFBBFF80" "#EEAEEE80" "#CD96CD80" "#8B668B80"
#> [546] "#B0E0E680" "#A020F080" "#9B30FF80" "#912CEE80" "#7D26CD80"
#> [551] "#551A8B80" "#FF000080" "#FF000080" "#EE000080" "#CD000080"
#> [556] "#8B000080" "#BC8F8F80" "#FFC1C180" "#EEB4B480" "#CD9B9B80"
#> [561] "#8B696980" "#4169E180" "#4876FF80" "#436EEE80" "#3A5FCD80"
#> [566] "#27408B80" "#8B451380" "#FA807280" "#FF8C6980" "#EE826280"
#> [571] "#CD705480" "#8B4C3980" "#F4A46080" "#2E8B5780" "#54FF9F80"
#> [576] "#4EEE9480" "#43CD8080" "#2E8B5780" "#FFF5EE80" "#FFF5EE80"
#> [581] "#EEE5DE80" "#CDC5BF80" "#8B868280" "#A0522D80" "#FF824780"
#> [586] "#EE794280" "#CD683980" "#8B472680" "#87CEEB80" "#87CEFF80"
#> [591] "#7EC0EE80" "#6CA6CD80" "#4A708B80" "#6A5ACD80" "#836FFF80"
#> [596] "#7A67EE80" "#6959CD80" "#473C8B80" "#70809080" "#C6E2FF80"
#> [601] "#B9D3EE80" "#9FB6CD80" "#6C7B8B80" "#70809080" "#FFFAFA80"
#> [606] "#FFFAFA80" "#EEE9E980" "#CDC9C980" "#8B898980" "#00FF7F80"
#> [611] "#00FF7F80" "#00EE7680" "#00CD6680" "#008B4580" "#4682B480"
#> [616] "#63B8FF80" "#5CACEE80" "#4F94CD80" "#36648B80" "#D2B48C80"
#> [621] "#FFA54F80" "#EE9A4980" "#CD853F80" "#8B5A2B80" "#D8BFD880"
#> [626] "#FFE1FF80" "#EED2EE80" "#CDB5CD80" "#8B7B8B80" "#FF634780"
#> [631] "#FF634780" "#EE5C4280" "#CD4F3980" "#8B362680" "#40E0D080"
#> [636] "#00F5FF80" "#00E5EE80" "#00C5CD80" "#00868B80" "#EE82EE80"
#> [641] "#D0209080" "#FF3E9680" "#EE3A8C80" "#CD327880" "#8B225280"
#> [646] "#F5DEB380" "#FFE7BA80" "#EED8AE80" "#CDBA9680" "#8B7E6680"
#> [651] "#F5F5F580" "#FFFF0080" "#FFFF0080" "#EEEE0080" "#CDCD0080"
#> [656] "#8B8B0080" "#9ACD3280"
alpha("red", seq(0, 1, length.out = 10))
#> [1] "#FF000000" "#FF00001C" "#FF000039" "#FF000055" "#FF000071"
#> [6] "#FF00008E" "#FF0000AA" "#FF0000C6" "#FF0000E3" "#FF0000"
alpha(c("first" = "gold", "second" = "lightgray", "third" = "#cd7f32"), .5)
#> first second third
#> "#FFD70080" "#D3D3D380" "#CD7F3280"