The new command colorbarcolor(R,G,B,A) allows you to set the color and transparency of the color bar. The text on the colorbar will be white if the specified colorbar luminance is dark, otherwise the text will be black.
Be aware that the command resetdefaults() always sets your colorbar to opaque black (as if the script included the command colorbarcolor(0,0,0,255)), so if you want to reset defaults and set a custom colorbar color, you need to consider the order of these two commands.
This example script sets a translucent red color bar:
Latest commit includes enhancement suggested by Brandon Gunasekera to change the colorbar color and translucency.
The new command colorbarcolor(R,G,B,A) allows you to set the color and transparency of the color bar. The text on the colorbar will be white if the specified colorbar luminance is dark, otherwise the text will be black.
Be aware that the command
resetdefaults()
always sets your colorbar to opaque black (as if the script included the commandcolorbarcolor(0,0,0,255)
), so if you want to reset defaults and set a custom colorbar color, you need to consider the order of these two commands.This example script sets a translucent red color bar:
The Color/Colobar menu allows the user to choose from four default options. The equivalent script commands are:
gl.colorbarcolor(255,255,255,255)
gl.colorbarcolor(255,255,255,168)
gl.colorbarcolor(0,0,0,255)
gl.colorbarcolor(0,0,0,168)
This function will be included in the next release. To test compile from code.