From 482a6afcd737cacfe720b36c3c45949a9225906d Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 14 Jun 2005 19:18:31 +0000 Subject: [PATCH] incipient angle_to_colour --- layout/plan-to-gui-data | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/layout/plan-to-gui-data b/layout/plan-to-gui-data index acfd2d7..35495a1 100755 --- a/layout/plan-to-gui-data +++ b/layout/plan-to-gui-data @@ -232,9 +232,33 @@ for ($p{Y}=0; $p{Y}<$sz{Y}; $p{Y}++) { #xpm_cmap("on","ion"); #xpm_cmap("on","idet"); +sub angle_to_colour ($) { + my ($angle) = @_; + my ($s,$f,$u,$U,$d,$D,$R); + + $s= floor($angle); + $f= $angle - $s; + + $u= $f * 0.5; + $U= $u + 0.5; + $d= 0.5 - $u; + $D= $d + 0.5; + + $R= ([ D, U, 0 ], + [ d, 1, u ], + [ 0, D, U ], + [ u, d, 1 ], + [ U, 0, D ], + [ 1, u, d ])[$s]; + $R->[1] *= 0.9; + return @$R; +} + sub ang_cmaps () { my ($ang); for ($ang=0; $ang<(1<<$datum_numbits{Angle}); $ang++) { + ($ang+0.0) / 1<<$datum_numbits{Angle}; + } } -- 2.30.2