rordenlab / MRIcroGL

v1.2 GLSL volume rendering. Able to view NIfTI, DICOM, MGH, MHD, NRRD, AFNI format images.

Home Page:https://www.nitrc.org/plugins/mwiki/index.php/mricrogl:MainPage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

colorbarcolor

neurolabusc opened this issue · comments

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 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:

import gl
gl.resetdefaults()
gl.loadimage('spm152')
gl.colorbarcolor(255,0,0,160)

The Color/Colobar menu allows the user to choose from four default options. The equivalent script commands are:

  • opaque white: gl.colorbarcolor(255,255,255,255)
  • translucent white: gl.colorbarcolor(255,255,255,168)
  • opaque black: gl.colorbarcolor(0,0,0,255)
  • translucent black: gl.colorbarcolor(0,0,0,168)

This function will be included in the next release. To test compile from code.