#!/usr/bin/env python
# -*- coding: utf-8 -*-

import numpy as np
from matplotlib import colors


def hsv(n=63):
    """
    adapted from Octave's (NOT matlab's) hsv(N) function
      which is equivalent to matlab's hsv2rgb([(0:N-1)'/N, ones(N,2)])
      from: http://octave.sourceforge.net/octave/function/hsv.html
            http://stackoverflow.com/q/23945764/583834
    """

    return colors.hsv_to_rgb(np.column_stack([np.linspace(0, 1, n + 1), np.ones(((n + 1), 2))]))
