Below is useful widget I keep around in K.CoSy . It will be
among a number of enhancements to the next edition coming soon .
I have added a link to it and an image of it to
http://cosy.com/K/CoSy.htm .
It raises a question about "vector from scalar" , old "represent" .
16 _vs -1 0 1 10 20 / makes sense .
(15 0 0 0 1
15 0 1 10 4)
16 _vs 20 / right .
1 4
16 _vs 1 / right .
,1
16 _vs 0 / Huh ! ? .
!0
16 _vs -1 / well , ok .
15 15 15 15 15 15 15 15
--
/(/ Color pallet . execute each line to create / -----------------
I created this to have a numerical pallet I could understand .
Presents table of primary colors with there K encodings .
Shows color of sum of colors clicked .
/)/
.R : _d / to make definition dictionary independent
/ .R , the root , is generally `.CoSy for me .
d2h : { "0123456789ABCDEF" @ 16 16 _vs x }
d2h..h : " format integers as hex "
Pallet.colors : ( 0 , 3 + 4 * ! 25 ) */: 10000 100 1
/ K's R G B encoding , 0 - 99 each , stepping by 4 .
Pallet.colors..bg : Pallet.colors
/ Set background colors to the same values
Pallet.colors..k : " .[ `ci ; _i 0 ; : ; _v . _i ] ; "
/ set cursor klik to update "color index" `ci .
Pallet.ci : 3 # 0 0 0 / initialize index keeping variable
Pallet.ci..t : " hexcolor..bg : color..bg : color : +/ ci "
/ set trigger to update colors , etc , to sum of ci .
Pallet.scalecolor : { _ ( ( 3 # 100 ) _vs x ) * 255 % 99 }
Pallet.hexcolor..d : " ,/ ( .R `d2h )' scalecolor color "
Pallet..c : `form
Pallet..a : ( `color `hexcolor ; `colors )
`show $ `Pallet
-- Bob Armstrong --
http://CoSy.com -- 212-285-1864
K.CoSy Rapid Quantitative Modeling
language and consulting
2001/09/25 16:32:47