diff --git a/zUtil_Cryst/gtCrystVector2SST.m b/zUtil_Cryst/gtCrystVector2SST.m index 6cb5985abb07a43f7a8694a1e2b78313c7053bfa..8ad4b159eaeacc5f29768ac5c8dbc94241446d7a 100644 --- a/zUtil_Cryst/gtCrystVector2SST.m +++ b/zUtil_Cryst/gtCrystVector2SST.m @@ -1,7 +1,7 @@ -function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, saturation) +function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, saturate) % GTCRYSTVECTOR2SST Moves crystal vectors to SST zone. % -% [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm[, saturation]) +% [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm[, saturate]) % ------------------------------------------------------------------------------- % % INPUT: @@ -10,7 +10,7 @@ function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, satur % symm = <cell_array> Symmetry operators % % OPTINAL INPUT: -% saturation = <logical> Saturate or not the RGB output {true} +% saturate = <logical> Saturate or not the RGB output {true} % % OUTPUT: % rgb = <double> RGB colors in the SST triangle @@ -20,8 +20,8 @@ function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, satur % % Version 001 15-10-2012 by YGuilhem - if ~exist('saturation', 'var') || isempty(saturation) - saturation = true; + if ~exist('saturate', 'var') || isempty(saturate) + saturate = true; end % Normalize vectors? @@ -57,7 +57,7 @@ function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, satur switch crystal_system case {'cubic', 'cub'} - anglesR = 45 - Vc_chi; % red color proportional to (45-chi) + anglesR = 45 - Vc_chi; % red color proportional to (45 - chi) minAngleR = 0; maxAngleR = 45; anglesB = Vc_phi; % blue color proportional to phi @@ -120,7 +120,8 @@ function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, satur blue = (maxAngleR - angleR)/maxAngleR .* angleB/maxAngleB; rgb = [red green blue]; - if saturation + if saturate + rgb = sqrt(rgb); sat = max(rgb, [], 2); rgb = rgb./sat(:, [1 1 1]); end