annotate nonExposed/generateColormap.m @ 29:5dcaeea87bdb

addition of logos
author Lagrange <lagrange@ircam.fr>
date Fri, 20 Jan 2017 15:50:01 +0100
parents b1901e8d8f5f
children
rev   line source
mathieu@14 1 function cmap = generateColormap (sceneObjects)
mathieu@14 2 % returns a colormap with randomly chosen colors somewhat evenly spread in
mathieu@14 3 % the color spectrum, to be used for the graphical representations of a
mathieu@14 4 % synthesized scene.
mathieu@14 5
mathieu@14 6 % Background sounds will have a saturation of .3, foreground sounds of 1
mathieu@14 7 % Value is always let to .5, since modifying it would erroneously suggest
mathieu@14 8 % a difference of intensity
mathieu@14 9
mathieu@14 10 % This program was written by Mathias Rossignol & Grégoire Lafay
mathieu@14 11 % is Copyright (C) 2015 IRCAM <http://www.ircam.fr>
mathieu@14 12 %
mathieu@14 13 % This program is free software: you can redistribute it and/or modify it
mathieu@14 14 % under the terms of the GNU General Public License as published by the Free
mathieu@14 15 % Software Foundation, either version 3 of the License, or (at your option)
mathieu@14 16 % any later version.
mathieu@14 17 %
mathieu@14 18 % This program is distributed in the hope that it will be useful, but
mathieu@14 19 % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
mathieu@14 20 % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mathieu@14 21 % for more details.
mathieu@14 22 %
mathieu@14 23 % You should have received a copy of the GNU General Public License along
mathieu@14 24 % with this program. If not, see <http://www.gnu.org/licenses/>.
mathieu@14 25
mathieu@14 26 nbTracks = length(sceneObjects);
mathieu@14 27
mathieu@14 28 % Colors for figures
mathieu@14 29 % Choosing color hues evenly spread in the color spectrum, then randomizing their order
mathieu@14 30 hues = (0:1/nbTracks:1);
mathieu@14 31 hues = hues(1:nbTracks);
mathieu@14 32 hues = hues(randperm(nbTracks));
mathieu@14 33 % Generate a colormap:
mathieu@14 34 for c=1:nbTracks
mathieu@14 35 if (sceneObjects(c).isBackground)
mathieu@14 36 cmap(c,:) = hsl2rgb([hues(c), .3, .5]);
mathieu@14 37 else
mathieu@14 38 cmap(c,:) = hsl2rgb([hues(c), 1, .5]);
mathieu@14 39 end
mathieu@14 40 end
mathieu@14 41
mathieu@14 42
mathieu@14 43 end