def _check_color_dim(val):
 val = np.atleast_2d(val)
 if (val.shape[1] not in (3, 4)):
  raise RuntimeError('Value must have second dimension of size 3 or 4')
 return (val, val.shape[1])

def _check_color_dim ( val ) : val = np . atleast_2d ( val ) if ( val . shape [ 1 ] not in ( 3 , 4 ) ) : raise RuntimeError ( 'Value must have second dimension of size 3 or 4' ) return ( val , val . shape [ 1 ] )
ensure val is nx .