{deck}
version:1
card:0
size:[512,342]
script:"0"
name:"color.deck"

{script:0}
on reset_pal do
 local default_pal:"%J" parse "[
  16777215,16776960,16737536,14417920,
  16711831, 3539095,     202,   38911,
     43008,   25856, 6632960, 9921846,
  12171705, 8816262, 4539717,       0,
 ]"
 each c i in default_pal
  patterns[32+i]:c
 end
end

{end}

{card:Index}
image:"%%[encoded data, 7420 characters]"
script:"Index.0"
{widgets}
field1:{"type":"field","size":[115,15],"pos":[331,185],"locked":1,"border":0,"align":"right","value":"An interactive tutorial"}
forpedants:{"type":"canvas","size":[22,36],"pos":[337,95],"locked":1,"show":"none","border":0,"image":"%%IMG0ABYAJAAAAAAAAAAAAAAAAAAAAAADAAAHgAwHgB4HwB4HwB4DwB8DwB8DwA8HwA8HgA//gA//AAf/AAP+AAAAAAAAAAAAAAAAAADAwAHh4AHj4AHz4AD/wAB/gAA/gAAfAAAOAAAAAAAAAAAAAAAAAA==","scale":1}
button1:{"type":"button","size":[94,23],"pos":[401,306],"script":"Index.1","text":"Begin..."}
index:{"type":"field","size":[292,112],"pos":[9,223],"locked":1,"volatile":1,"script":"Index.2","scrollbar":1}
version:{"type":"field","size":[25,14],"pos":[7,22],"locked":1,"volatile":1,"border":0}

{script:Index.0}
on view do
 bullet:image["%%IMG0AAYADQAAAAB49Pz8/HgAAAA="]
 i:select c:key t:value..widgets.title.text where value..widgets.title from deck.cards
 index.value:raze each row in rows i
  rtext.make["" "" bullet],
  rtext.make["  "],
  rtext.make[("%s\n" format row.t) "mono" row.c]
 end
 version.text:"v%0.1f" format deck.modules.col.version
 forpedants.toggle["solid" !random[5]]
end
{end}

{script:Index.1}
on click do
  go["Next" "SlideLeft" 15]
end
{end}

{script:Index.2}
on link val do
 go[val "BoxIn" 15]
end
{end}

{card:logicalcolor}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8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wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A6w=="
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"Logical Color"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"In Decker, you can make drawings which use a variety of 1-bit stippled patterns, like you see on the left.\n\nDecker considers these patterns \"Logical Colors\": every pixel of a crosshatched region knows that it is crosshatched, whether that pixel happens to appear to the user as black or white.\n\nRemembering this information about patterns allows the Flood tool to replace entire regions of a pattern, rather than only connected areas of black or white pixels."}

{script:logicalcolor.0}
on click do
 t.Prev:"SlideRight"
 t.Next:"SlideLeft"
 t.Index:"BoxOut"
 go[me.text t[me.text] 15]
end
{end}

{card:thepalette}
image:"%%[encoded data, 16204 characters]"
script:"thepalette.0"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"The Palette"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[223,238],"pos":[279,48],"locked":1,"border":0,"value":{"text":["Decker uses a palette of 48 patterns and colors, some of which have special properties which we will discuss in turn:\n\n- Pattern 0 is ","transparent.","\n- Pattern 1 is solid black.\n- Patterns 2-27 are repeating 1-bit textures.\n- Patterns 28-31 are ","animated patterns",".\n- Patterns 32-47 are ","solid colors",".\n\nThe appearance of most of these patterns can be manipulated with Lil scripts on the fly via the ","Patterns interface",".\n\nImage interfaces represent each pixel with a byte, which means it can technically be assigned a value between 0 and 255. Patterns above 47 cannot be drawn with manually and are reserved for future use."],"font":["","","","","","","","",""],"arg":["","transparency","","animatedpatterns","","solidcolors","","patternsinterface",""]}}

{script:thepalette.0}
on view do
 reset_pal[]
end
{end}

{card:flatteningpatterns}
image:"%%[encoded data, 16252 characters]"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"Flattening Patterns"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"Sometimes you might want to \"flatten\" a pattern into just plain black-and-white pixels (patterns 1 and 0, respectively), discarding the \"Logical Color\" of the individual pixels.\n\nIf you make a selection with the Select or Lasso tool, you can flatten any patterned pixels by using \"Edit -> Invert\" from the menu twice in succession.\n\nOne of the example swatches to the left has been \"flattened\". Try using the Flood tool on each swatch and observe the difference in behavior!\n\nWhen you're done, return to the \"Interact\" tool."}
field2:{"type":"field","size":[85,14],"pos":[37,113],"locked":1,"border":0,"align":"center","value":"Gray Pattern"}
field3:{"type":"field","size":[85,14],"pos":[132,113],"locked":1,"border":0,"align":"center","value":"\"Flattened\" Gray"}

{card:transparency}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8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/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AEU="
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"Transparency"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"Decker usually displays cards with what appears to be a white background, but there are actually two  patterns which look this way:\n\nPattern 0 is \"transparent\".\nPattern 32 is \"opaque white\".\n\nTry switching to any drawing tool from the \"Tool\" menu, and then enable \"Transparency Mask\" from the \"View\" menu. All the transparent pixels on the card background will be shown in a gray color, while opaque white remains white.\n\nWhen you're done, return to the \"Interact\" tool."}
field2:{"type":"field","size":[85,14],"pos":[37,113],"locked":1,"border":0,"align":"center","value":"Fully Transparent"}
field3:{"type":"field","size":[85,14],"pos":[132,113],"locked":1,"border":0,"align":"center","value":"Partially Opaque"}

{card:transparentcanvases}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/ACgNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AIsNdgD/AI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8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AMw=="
script:"transparentcanvases.0"
{widgets}
note:{"type":"field","size":[137,14],"pos":[61,83],"locked":1,"border":0,"align":"center","value":"Drag Lily (gently!)"}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"Transparent Canvases"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"The distinction between transparency and opaque white is most important when manipulating canvases: a partially-transparent canvas can be positioned above a card background or other widgets.\n\nTry dragging Lily the Exposition Fairy around, and observe how her image contains both opaque white and transparent areas.\n\nYou can use \"Transparency Mask\" mode as shown on the previous card to help prepare semi-transparent graphics for canvases.\n\nAdding a black or white outline to semi-transparent images is often a useful technique for helping them remain clearly legible on a variety of 1-bit backgrounds."}
lily:{"type":"canvas","size":[91,106],"pos":[87,114],"locked":1,"script":"transparentcanvases.1","show":"transparent","border":0,"image":"%%IMG2AFsAagAYIAIAWCABAQIgAQBWIAEBBCAFAFEgAQEJIAIATyABAQsgAgBNIAEBAyABAQkgAwBKIAEBAyAGAQcgAgBIIAEBAyAIAQcgBABE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BiADAAIgAwEaIAQAByABAQYgAgAfIAMBBiAFAQYgDwEEIAEACyABAQEgAQEBIAMAJCABAQ8gAQAOIAEBBCABAAsgAQEBIAEBASABACcgAgEMIAEADyABAQQgAQAKIAEBASACAQEgAQApIAMBBiADABEgAQEDIAEACyACAQEgAQAtIAYAEiACAQQgAQANIAEARCACAQYgAQBRIAEBBiACAFIgAQEBIAEBASADAFQgAQEBIAEBASABAFUgAgEBIAEBASABAFQgAQECIAIBASABAFUgAwEBIAEAWSABAC0=","draggable":1,"scale":1}
normal:{"type":"canvas","size":[91,106],"pos":[189,305],"locked":1,"show":"none","border":0,"image":"%%IMG2AFsAagAYIAIAWCABAQIgAQBWIAEBBCAFAFEgAQEJIAIATyABAQsgAgBNIAEBAyABAQkgAwBKIAEBAyAGAQcgAgBIIAEBAyAIAQcgBABEIAEBAyAKAQkgAQBDIAEBAyANAQcgAgBBIAEBAyAPAQcgAgA/IAEBAyATAQUgAQA+IAEBAyAUAQUgAQA9IAEBAyAWAQQgAgA7IAEBAyAYAQQgAQA6IAEBAyAZAQQgAQA5IAEBAyAaAQQgAQA4IAEBAyAcAQMgAQA3IAEBAyAdAQMgAQA2IAEBAyAdAQMgAQA2IAEBAyAeAQMgAQA1IAEBAyAfAQMgAQA0IAEBAyAgAQMgAQAzIAEBAyAhAQMgAQAyIAEBAyARAQYgCgEDIAEAMiABAQMgEAEDDAMBAyAJAQMgAQAxIAEBAyAPAQIMBgEDIAkBAyABADAgAQEDIA4BAwwIAQIgCAEEIAEALiABAQMgDwECDAkBAyAIAQMgAQAIIAIAJCABAQMgDwECDAQBAQwFAQIgCQEDIAgBAiAFAB8gAQEDIA8BAgwDAQEgAQEBDAQBAiAJARIgAQAeIAEBAyAPAQIMBQEBDAQBAyABARogAQAdIAEBAyAQAQMMAgECDAQBHiABAB0gAQEDIBABBwwEAQ4gDAEDIAEAHiABAQMgEQEFDAUBCSAHAQcgAwEDIAEADyALAAQgAQEDIAcBDgwGAQggBwEBIAoBBCACA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EEIAEAAiABAQMgAQECIA0BAiAFAQMgGQEEIAEAFyABAQMgAQADIAEBAyACAQIgCgEDIAYBAiAZAQQgAQAXIAEBAyABAAQgAQEDIAMBAiAIAQUgBAECIBgBBSABABcgAQEEIAEABCABAQMgBAECIAUBCSABAQIgGAEFIAEAFyABAQQgAQAEIAEBASABAQMgBAEGIAUBBiAXAQYgAQAYIAEBAyABAAMgAgECIAEBAyAGAQEgCwEBIBUBCSABABkgAQEDIAEAAiABAQMgAgEDICYBCCABAQIgAQAZIAEBAyABAAMgAwABIAEBAyAjAQkgAwECIAEAGSABAQQgAQAGIAEBAyAgAQkgAwABIAEBAyABABogAQEEIAEABSABAQUgGgEKIAMABCABAQMgAQAbIAEBBCACAAQgAQElIAMAByABAQMgAQAbIAEBBiABAAQgAQEhIAMABSAFAQMgAQAdIAEBBiADAAIgAwEaIAQAByABAQYgAgAfIAMBBiAFAQYgDwEEIAEACyABAQEgAQEBIAMAJCABAQ8gAQAOIAEBBCABAAsgAQEBIAEBASABACcgAgEMIAEADyABAQQgAQAKIAEBASACAQEgAQApIAMBBiADABEgAQEDIAEACyACAQEgAQAtIAYAEiACAQQgAQANIAEARCACAQYgAQBRIAEBBiACAFIgAQEBIAEBASADAFQgAQEBIAEBASABAFUgAgEBIAEBASABAFQgAQECIAIBASABAFUgAwEBIAEAWSABAC0=","scale":1}
sick:{"type":"canvas","size":[91,106],"pos":[245,305],"locked":1,"show":"none","border":0,"image":"%%IMG2AFsAagAYIAIAWCABAQIgAQBWIAEBBCAFAFEgAQEJIAIATyABAQsgAgBNIAEBAyABAQkgAwBKIAEBAyAGAQcgAgBIIAEBAyAIAQcgBABEIAEBAyAKAQkgAQBDIAEBAyANAQcgAgBBIAEBAyAPAQcgAgA/IAEBAyATAQUgAQA+IAEBAyAUAQUgAQA9IAEBAyAWAQQgAgA7IAEBAyAYAQQgAQA6IAEBAyAZAQQgAQA5IAEBAyAaAQQgAQA4IAEBAyAcAQMgAQA3IAEBAyAdAQMgAQA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ASIAIBBCABAA0gAQBEIAIBBiABAFEgAQEGIAIAUiABAQEgAQEBIAMAVCABAQEgAQEBIAEAVSACAQEgAQEBIAEAVCABAQIgAgEBIAEAVSADAQEgAQBZIAEALQ==","scale":1}
mad:{"type":"canvas","size":[91,106],"pos":[325,305],"locked":1,"show":"none","border":0,"image":"%%IMG2AFsAagAYIAIAWCABAQIgAQBWIAEBBCAFAFEgAQEJIAIATyABAQsgAgBNIAEBAyABAQkgAwBKIAEBAyAGAQcgAgBIIAEBAyAIAQcgBABEIAEBAyAKAQkgAQBDIAEBAyANAQcgAgBBIAEBAyAPAQcgAgA/IAEBAyATAQUgAQA+IAEBAyAUAQUgAQA9IAEBAyAWAQQgAgA7IAEBAyAYAQQgAQA6IAEBAyAZAQQgAQA5IAEBAyAaAQQgAQA4IAEBAyAcAQMgAQA3IAEBAyAdAQMgAQA2IAEBAyAdAQMgAQA2IAEBAyAeAQMgAQA1IAEBAyAfAQMgAQA0IAEBAyAgAQMgAQAzIAEBAyAhAQMgAQAyIAEBAyARAQYgCgEDIAEAMiABAQMgEAEDDAMBAyAJAQMgAQAxIAEBAyAPAQIMBgEDIAkBAyABADAgAQEDIA4BAwwIAQIgCAEEIAEALiABAQMgDwECDAkBAyAIAQMgAQAIIAIAJCABAQMgDwECDAQBAQwFAQIgCQEDIAgBAiAFAB8gAQEDIA8BAgwDAQEgAQEBDAQBAiAJARIgAQAeIAEBAyAPAQIMBQEBDAQBAyABARogAQAdIAEBAyAQAQMMAgECDAQBHiABAB0gAQEDIBABBwwEAQ4gDAEDIAEAHiABAQMgEQEFDAUBCSAHAQcgAwEDIAEADyALAAQgAQEDIAcBDgwGAQggBwEBIAoBBCACAAogAwELIAUBFwwGAQMgDQEBIAkBByACAAcgAQEoDAgBAyAWAQogAQAFIAEBJSACAQQMBAEEIAoBAiAKAQQgAwEFIAEABSABAQQgCgEIIAYBBiAFAQsgCAEDIAIBASAEAQcgAQADIAIBBCABAAUgAQEDICQBCSAHAQYgAQEBIAEBCSABAAIgAgACIAEBBCABAAUgAQEDIAgBCSAQAQEgAwEFIAQBASACAQogAQEIIAQBAiABAAIgAQEEIAEABCABAQQgEAEBIBwBASABAQYgAQEEIAEBByACAQQgAQAEIAEBAyABAAUgAQEFIA4BASARAQEgAgEBIAcBBCACAQcgAQEDDAEBCSABAAQgAQEDIAEABiABAQYgHwEBIAEBASAJAQIgAgEGIAIBAwwDAQcgAgABIAEAASABAQMgAQAHIAEBCSAMARAgBwEBIAEBASACAQggBAEDDAYBBSABAQEgAgEDIAEACCADAQ0gBAERIAMBASAHAQUgAQECIAEBASADAQMMBQEDIAMBASABAAEgAQEDIAEACyACAQwgBAECIAMBAiACAQUgAgEBIAcBASACAQkgBQECDAUBAiABAAMgAQABIAIBAyABAA0gBAEIIAQBAiADAQIgAgEFIAUBASANAQEgAgEBIAQBAgwEAQMgBgEEIAEAESABAQMMAgEDIAIBBCAEAQggEQEBIAIBASACAQEgAwECDAQBAyABAQkgAQARIAEBAgwDAQIgCwEFIAEBAiABAQEgBwECIAcBASACAQEgBAEDDAIBDiABABEgAQECDAQBAiAOAQYgBwEBIAIBAiAMARIgAgASIAEBAgwEAQIgCgEBIAQBAyAIAQEgBQEBIAoBAyABAQkgBgATIAEBAgwFAQIgCwEEIAMBASAGAQEgEAECIAMBBiADABkgAQECDAUBAiAHAQEgBwEBIAkBASAOAQMgBQEEIAEAHCABAQMMBAEDIAcBASABAQEgAQEBIAUBASATAQIgAQEBIAcBAyABABAgDgECDAMBBCAKAQEgAQEBIAEBASADAQEgDwEDIAMBASACAQEgBQEDIAoABSABAREMAgEFIA4BASAPAQMgBQEBIAMBAiAEAQ0gAgACIAEBHiAXAQIgCAEBIAQBASAFAQ4gAQABIAEBGCABAQwgBgEKIAkBASAFAQIgBAEPIAIBAyANAQggBwECIAMBByAIAQEgAQEBIAcBAiAGAQIgAgEFIAgBAyACAQMgAQAEIAUAASACAQMgAgEDIAgBAiAQAQIgAgECIAQBAiAIAQEgAQEHIAUAASABAQ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EIAEBAyAEAQIgBQEJIAEBAiAYAQUgAQAXIAEBBCABAAQgAQEBIAEBAyAEAQYgBQEGIBcBBiABABggAQEDIAEAAyACAQIgAQEDIAYBASALAQEgFQEJIAEAGSABAQMgAQACIAEBAyACAQMgJgEIIAEBAiABABkgAQEDIAEAAyADAAEgAQEDICMBCSADAQIgAQAZIAEBBCABAAYgAQEDICABCSADAAEgAQEDIAEAGiABAQQgAQAFIAEBBSAaAQogAwAEIAEBAyABABsgAQEEIAIABCABASUgAwAHIAEBAyABABsgAQEGIAEABCABASEgAwAFIAUBAyABAB0gAQEGIAMAAiADARogBAAHIAEBBiACAB8gAwEGIAUBBiAPAQQgAQALIAEBASABAQEgAwAkIAEBDyABAA4gAQEEIAEACyABAQEgAQEBIAEAJyACAQwgAQAPIAEBBCABAAogAQEBIAIBASABACkgAwEGIAMAESABAQMgAQALIAIBASABAC0gBgASIAIBBCABAA0gAQBEIAIBBiABAFEgAQEGIAIAUiABAQEgAQEBIAMAVCABAQEgAQEBIAEAVSACAQEgAQEBIAEAVCABAQIgAgEBIAEAVSADAQEgAQBZIAEALQ==","scale":1}
shaken:{"type":"button","size":[60,20],"pos":[102,54],"show":"none","style":"check","value":0}

{script:transparentcanvases.0}
on view do
 shaken.value:0
 lily.paste[normal.copy[]]
 note.text:"Drag Lily (gently!)"
end
{end}

{script:transparentcanvases.1}
on drag pos do
 if 20<mag pointer.pos-pointer.prev
  lily.paste[sick.copy[]]
  shaken.value:1
  note.text:"Drag Lily (I said GENTLY!)"
 end
end

on release pos do
 lily.paste[(if shaken.value mad else normal end).copy[]]
end
{end}

{card:animatedpatterns}
image:"%%[encoded data, 4700 characters]"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"Animated Patterns"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"Patterns 28, 29, 30, and 31 are \"animated patterns\" which cycle through up to 8 other pattern indices at 15 frames per second.\n\nThese patterns can be found at the bottom of the palette toolbar. (Enable the toolbars with \"Decker -> Toolbars\" from the menu.)\n\nThis animation will take place entirely automatically, with no scripting required. Used sparingly, animated patterns are a very effective way to draw attention to elements of a card and bring images to life; large regions can be somewhat visually overwhelming.\n\n\"View -> Show Animation\" in the menu can be used to temporarily pause animated patterns."}
field2:{"type":"field","size":[160,20],"pos":[49,134],"locked":1,"border":0,"style":"code","value":"13   9    5   1    5   9"}

{card:solidcolors}
image:"%%[encoded data, 6720 characters]"
script:"thepalette.0"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"Solid Colors"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[216,238],"pos":[286,48],"locked":1,"border":0,"value":"Patterns 32 to 47 form a palette of 16 solid colors.\n\nYou can draw with these colors manually by choosing any drawing tool and then selecting \"Style -> Color\" from the menu. This will replace the usual 1-bit textures in the toolbar and Stroke/Fill dialog boxes with the palette you see on the left.\n\nNote that patterns 32 and 47 are the colors Decker itself uses for drawing \"white\" and \"black\" areas of its user interface. As we will see shortly, it is possible to customize Decker's palette on the fly, but at any given time only 16 distinct colors may be shown on the screen."}

{card:patternsinterface}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/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D/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AFM="
script:"patternsinterface.0"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"The Patterns Interface: Basics"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"The Patterns interface allows 1-bit textures, animated patterns, and solid colors to be inspected or modified by index.\n\nIt can be obtained as the global variable \"patterns\" or via \"deck.patterns\".\n\nPatterns 0 and 1 cannot be redefined; they're always fully transparent and solid \"black\" (palette color 47), respectively.\n\nPatterns 2-27 can be read or written as an 8x8 pixel Image interface. Try using the canvas on the left to modify pattern 26, and have a look inside the canvas scripts to see how this works!"}
editor:{"type":"canvas","size":[80,80],"pos":[29,124],"volatile":1,"script":"patternsinterface.1","scale":10}
button4:{"type":"button","size":[126,20],"pos":[69,240],"script":"patternsinterface.2","text":"Reset To Default"}
field2:{"type":"field","size":[85,23],"pos":[26,98],"locked":1,"border":0,"align":"center","value":"click and drag\nto draw:"}

{script:patternsinterface.0}
on view do
 editor.paste[patterns[26]]
end
{end}

{script:patternsinterface.1}
on click pos do
 me.pattern:!me[pos]
 edit[]
end

on drag pos do
 send drag[pos]
 edit[]
end

on release pos do
 drag[pos]
 edit[]
end

on edit do
 patterns[26]:me.copy[]
end
{end}

{script:patternsinterface.2}
on click do
 patterns[26]:image["%%IMG0AAgACKoAiBQiQYgA"]
 view[]
end
{end}

{card:patternsanimation}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8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A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AOc="
script:"thepalette.0"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"The Patterns Interface: Animation"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"Patterns 28, 29, 30, and 31 can be read or written as a list of up to 8 indices of other patterns.\n\nIn the example to the left, we redefine an animated pattern several times sequentially to produce different animation sequences.\n\nThe default animation sequences are all based on 1-bit textures, but animated patterns can also use solid colors. You may find it useful to set up an \"animated\" pattern which is simply a single texture or solid color as a convenient way to non-destructively re-map colors within card backgrounds or other images."}
ex1:{"type":"field","size":[232,174],"pos":[10,48],"border":1,"style":"code","value":"orig:patterns[29]\n\npatterns[29]:34\nsleep[60]\n\npatterns[29]:21,23\nsleep[60]\n\npatterns[29]:21,21,21,23,23,23\nsleep[120]\n\npatterns[29]:orig"}
button4:{"type":"button","size":[60,20],"pos":[255,202],"script":"patternsanimation.0","text":"Try It!"}
field2:{"type":"field","size":[59,23],"pos":[94,229],"locked":1,"border":0,"align":"center","value":"animated pattern 29:"}

{script:patternsanimation.0}
on click do
 eval[ex1.text () 1]
end
{end}

{card:patternscolors}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/A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/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8Avw=="
script:"patternscolors.0"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"The Patterns Interface: Colors"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"Patterns 32 through 47 can be read and written as integers containing a \"packed RGB\" representation of a color.\n\nIn hexadecimal notation, we could view a packed rgb integer as two digits of a \"red channel\", two digits of a \"blue channel\", and two digits of a \"green channel\", where each channel indicates the intensity of an additive primary color, from 00-FF in hex or 0-255 in decimal.\n\n\n\n\n\n\n\n\n\nDecker provides a dictionary named \"colors\" with names for every color slot. Using these constants instead of pattern indices can help make your scripts more readable!"}
hex:{"type":"field","size":[100,15],"pos":[80,158],"locked":1,"volatile":1,"style":"code","align":"center"}
pat:{"type":"slider","size":[100,25],"pos":[35,94],"script":"patternscolors.1","interval":[32,47],"value":36,"style":"compact"}
sample:{"type":"canvas","size":[80,25],"pos":[144,94],"locked":1,"volatile":1,"scale":1}
field2:{"type":"field","size":[96,15],"pos":[82,69],"locked":1,"border":0,"align":"center","value":"color index:"}
field3:{"type":"field","size":[96,15],"pos":[82,132],"locked":1,"border":0,"align":"center","value":"hex notation:"}
field4:{"type":"field","size":[96,15],"pos":[80,241],"locked":1,"border":0,"align":"center","value":"name:"}
name:{"type":"field","size":[100,15],"pos":[80,263],"locked":1,"volatile":1,"style":"code","align":"center"}

{script:patternscolors.0}
on view do
 reset_pal[]
 p:pat.value
 sample.clear[]
 sample.paste[sample.copy[].map[0 dict p]]
 hex.text:"%06H" format patterns[p]
 icolors:(range colors) dict (keys colors)
 name.text:"colors.%s" format icolors[p]
end
{end}

{script:patternscolors.1}
on change do
 view[]
end
{end}

{card:palettetransitions}
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"Palette Transitions"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,246],"pos":[254,48],"locked":1,"border":0,"value":{"text":["It is possible for every card in a deck to use a custom palette, though this may make editing decks a bit fiddly. Smoothly transitioning between such cards requires some special consideration for palettes, since ordinary transition effects like \"SlideLeft\" display both the origin and destination cards simultaneously.\n\nIn this example, we use an intermediate card which is entirely black to hide the point where we swap palettes. This specific approach requires the \"black\" and \"white\"  colors to remain the same in both palettes for a completely seamless effect.\n\n\n\n\nNote that using a single custom transition function to perform palette swaps can be somewhat brittle, as changes to transition timing or framerate may make it difficult for such a function to precisely identify the appropriate \"changeover\" point.\n\nThere are also user-created libraries for tackling this sort of problem. Check out ","PaletteFade"," for more ideas!"],"font":["","",""],"arg":["","https://itch.io/t/3984923/palettefade-module-a-decker-module-for-smoothly-fading-between-palettes",""]}}
ex1:{"type":"field","size":[232,151],"pos":[10,48],"border":1,"style":"code","value":"go[black \"BoxOut\" 15]\n\neach c i in beacon.widgets.pal.data\n patterns[i+32]:c\nend\n\ngo[beacon \"BoxIn\" 15]\n"}
button4:{"type":"button","size":[60,20],"pos":[254,179],"script":"patternsanimation.0","text":"Try It!"}

{card:coloverview}
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"The Col Module: Overview"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"This deck includes a module \"col\" which includes a variety of utility routines for working with packed rgb colors.\n\nThere are a suite of pairs of conversion functions for working with separate RGB components, Hue-Saturation-Value (HSV) color components, hexadecimal strings, and CSS color names. The \"col.to_\" functions convert a packed rgb color into the given representation, while the \"col.from_\" functions take some representation and produce a packed rgb color:\n\n- col.to_comp[] / col.from_comp[]\n- col.to_hsv[] / col.from_hsv[]\n- col.to_hex[] / col.from_hex[]\n- col.to_css[] / col.from_css[]\n\nThe module also provides some general utilities:\n\n- col.closest[rgb palette]\n"}
ex1:{"type":"field","size":[172,191],"pos":[49,72],"border":1,"style":"code","value":"# packed integer\n16767673\n\n# RGB components\n(255,218,185)\n\n# HSV components\n(0.078,0.27,1)\n\n# hex string\n\"FFDAB9\"\n\n# CSS name\n\"peachpuff\"\n"}

{card:colcomponents}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A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wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8Agg=="
script:"colcomponents.0"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"The Col Module: RGB Components"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"The col.to_comp[rgb] function converts a packed rgb integer into a list of red, green, and blue channel values ranging between 0 and 255.\n\nThe col.from_comp[(r,g,b)] function converts a list of red, green, and blue channel values into a packed rgb integer."}
rgb:{"type":"field","size":[100,20],"pos":[99,76],"script":"colcomponents.1","value":"16767673"}
comp:{"type":"field","size":[100,20],"pos":[99,192],"script":"colcomponents.2","value":"[255,218,185]"}
field3:{"type":"field","size":[64,15],"pos":[31,78],"locked":1,"border":0,"align":"right","value":"packed rgb"}
field2:{"type":"field","size":[64,35],"pos":[31,193],"locked":1,"border":0,"align":"right","value":"components (as JSON)"}
field4:{"type":"field","size":[75,15],"pos":[54,138],"locked":1,"border":0,"align":"center","value":"col.to_comp[]"}
field5:{"type":"field","size":[89,15],"pos":[156,138],"locked":1,"border":0,"align":"center","value":"col.from_comp[]"}
p1:{"type":"canvas","size":[22,20],"pos":[204,76],"locked":1,"volatile":1,"scale":1}
p2:{"type":"canvas","size":[22,20],"pos":[204,192],"locked":1,"volatile":1,"scale":1}

{script:colcomponents.0}
on view do
 patterns[42]:rgb.text
 patterns[43]:col.from_comp[comp.data]
 p1.clear[]
 p1.paste[p1.copy[].map[0 dict 42]]
 p2.clear[]
 p2.paste[p2.copy[].map[0 dict 43]]
end
{end}

{script:colcomponents.1}
on change val do
 comp.data:col.to_comp[me.text]
 view[]
end
{end}

{script:colcomponents.2}
on change val do
 rgb.text:col.from_comp[me.data]
 view[]
end
{end}

{card:colhsv}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AEEBAQBGAQEA/wC5AQEARgEBAP8AuQEBAEUBAwD/ALgBAQBFAQMA/wC4AQEARQEDAP8AuAEBAEQBBQD/ALcBAQBEAQUA/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/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8Agg=="
script:"colhsv.0"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"The Col Module: HSV Components"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"The col.to_hsv[rgb] function converts a packed rgb integer into a list of Hue, Saturation, and Value components.\n\nThe col.from_hsv[(h,s,v)] function converts a list of Hue, Saturation, and Value components into a packed rgb integer.\n\nHue, Saturation, and Value are all represented as normalized floating-point values between 0.0 and 1.0.\n\nNote that- unlike other conversion functions in the col module- neither of these functions are \"precise\": RGB and HSV values may accumulate error when converted in either direction!"}
rgb:{"type":"field","size":[100,20],"pos":[99,76],"script":"colhsv.1","value":"16718243"}
hsv:{"type":"field","size":[100,29],"pos":[99,192],"script":"colhsv.2","value":"[0.9,0.9,1]"}
field3:{"type":"field","size":[64,15],"pos":[31,78],"locked":1,"border":0,"align":"right","value":"packed rgb"}
field2:{"type":"field","size":[64,35],"pos":[31,193],"locked":1,"border":0,"align":"right","value":"components (as JSON)"}
field4:{"type":"field","size":[75,15],"pos":[54,138],"locked":1,"border":0,"align":"center","value":"col.to_hsv[]"}
field5:{"type":"field","size":[89,15],"pos":[156,138],"locked":1,"border":0,"align":"center","value":"col.from_hsv[]"}
p1:{"type":"canvas","size":[22,20],"pos":[204,76],"locked":1,"volatile":1,"scale":1}
p2:{"type":"canvas","size":[22,20],"pos":[204,192],"locked":1,"volatile":1,"scale":1}

{script:colhsv.0}
on view do
 patterns[42]:rgb.text
 patterns[43]:col.from_hsv[hsv.data]
 p1.clear[]
 p1.paste[p1.copy[].map[0 dict 42]]
 p2.clear[]
 p2.paste[p2.copy[].map[0 dict 43]]
end
{end}

{script:colhsv.1}
on change val do
 hsv.data:col.to_hsv[me.text]
 view[]
end
{end}

{script:colhsv.2}
on change val do
 rgb.text:col.from_hsv[me.data]
 view[]
end
{end}

{card:colhex}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/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D/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8Agg=="
script:"colhex.0"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"The Col Module: Hex Strings"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"The col.to_hex[rgb] function converts a packed rgb integer into a hexadecimal string consisting of \"RRGGBB\" digits.\n\nThe col.from_hex[str] function converts an \"RRGGBB\" or \"RGB\" hexadecimal string into a packed rgb integer. In the case of \"RGB\" strings, each supplied character is treated as being doubled. For example, \"FD2\" is equivalent to \"FFDD22\". Lowercase letters \"a\" through \"f\" are also accepted."}
rgb:{"type":"field","size":[100,20],"pos":[99,76],"script":"colhex.1","value":"16755384"}
hex:{"type":"field","size":[100,20],"pos":[99,192],"script":"colhex.2","value":"FFAAB8"}
field3:{"type":"field","size":[64,15],"pos":[31,78],"locked":1,"border":0,"align":"right","value":"packed rgb"}
field2:{"type":"field","size":[64,35],"pos":[31,193],"locked":1,"border":0,"align":"right","value":"hex string"}
field4:{"type":"field","size":[75,15],"pos":[54,138],"locked":1,"border":0,"align":"center","value":"col.to_hex[]"}
field5:{"type":"field","size":[89,15],"pos":[156,138],"locked":1,"border":0,"align":"center","value":"col.from_hex[]"}
p1:{"type":"canvas","size":[22,20],"pos":[204,76],"locked":1,"volatile":1,"scale":1}
p2:{"type":"canvas","size":[22,20],"pos":[204,192],"locked":1,"volatile":1,"scale":1}

{script:colhex.0}
on view do
 patterns[42]:0+rgb.text
 patterns[43]:col.from_hex[hex.text]
 p1.clear[]
 p1.paste[p1.copy[].map[0 dict 42]]
 p2.clear[]
 p2.paste[p2.copy[].map[0 dict 43]]
end
{end}

{script:colhex.1}
on change val do
 hex.text:col.to_hex[me.text]
 view[]
end
{end}

{script:colhex.2}
on change val do
 rgb.text:col.from_hex[me.text]
 view[]
end
{end}

{card:colcss}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AEEBAQBGAQEA/wC5AQEARgEBAP8AuQEBAEUBAwD/ALgBAQBFAQMA/wC4AQEARQED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/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8Agg=="
script:"colcss.0"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"The Col Module: CSS Names"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"The col.to_css[rgb] function converts a packed rgb integer into a valid CSS (Cascading Style Sheets) color string.\n\nThe col.from_css[(r,g,b)] function (which is frankly a bit more interesting) converts a CSS color string into a packed rgb integer. This function supports a useful subset of all possible CSS color names:\n\n- the 148 named CSS colors\n- #RGB\n- #RRGGBB\n- rgb(r, g, b)\n- rgba(r, g, b, a) (ignores alpha channel)\n\nin rgb() and rgba() formats, commas are optional and components may be specified as e.g. \"50%\" instead of \"128\".\n\nthe named css colors are also accessible as a dictionary from names to packed rgb integers \"col.cssnames\"."}
rgb:{"type":"field","size":[100,20],"pos":[99,76],"script":"colcss.1","value":"15792383"}
css:{"type":"field","size":[100,20],"pos":[99,192],"script":"colcss.2","value":"aliceblue"}
field3:{"type":"field","size":[64,15],"pos":[31,78],"locked":1,"border":0,"align":"right","value":"packed rgb"}
field2:{"type":"field","size":[64,35],"pos":[31,193],"locked":1,"border":0,"align":"right","value":"css color"}
field4:{"type":"field","size":[75,15],"pos":[54,138],"locked":1,"border":0,"align":"center","value":"col.to_css[]"}
field5:{"type":"field","size":[89,15],"pos":[156,138],"locked":1,"border":0,"align":"center","value":"col.from_css[]"}
p1:{"type":"canvas","size":[22,20],"pos":[204,76],"locked":1,"volatile":1,"scale":1}
p2:{"type":"canvas","size":[22,20],"pos":[204,192],"locked":1,"volatile":1,"scale":1}

{script:colcss.0}
on view do
 patterns[42]:rgb.text
 patterns[43]:col.from_css[css.text]
 p1.clear[]
 p1.paste[p1.copy[].map[0 dict 42]]
 p2.clear[]
 p2.paste[p2.copy[].map[0 dict 43]]
end
{end}

{script:colcss.1}
on change val do
 css.text:col.to_css[me.text]
 view[]
end
{end}

{script:colcss.2}
on change val do
 rgb.text:col.from_css[me.text]
 view[]
end
{end}

{card:colclosest}
image:"%%IMG2AgABVgD/AP8A/wD/AP8A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":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"The Col Module: col.closest[]"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"The col.closest[rgb pal] function finds the index in a palette \"pal\" which contains the color which is closest (based on a sum-of-squared-distance metric on RGB channels) to an input color \"rgb\".\n\nThe input color is given as a packed rgb integer, and the palette may be provided as either a list of packed rgb integers or a reference to a Patterns interface; in the latter case indices will be returned in the range 32-47.\n\nThis demonstration uses col.closest[] to perform reverse lookups against the named CSS colors: see the view[] function in the card script for details."}
hex:{"type":"field","size":[100,20],"pos":[99,116],"script":"patternscolors.1","value":"FF0031"}
css:{"type":"field","size":[100,20],"pos":[99,192],"locked":1,"volatile":1}
field3:{"type":"field","size":[64,15],"pos":[31,118],"locked":1,"border":0,"align":"right","value":"hex input"}
field2:{"type":"field","size":[64,35],"pos":[31,193],"locked":1,"border":0,"align":"right","value":"closest named css color"}
p1:{"type":"canvas","size":[22,20],"pos":[204,116],"locked":1,"volatile":1,"scale":1}
p2:{"type":"canvas","size":[22,20],"pos":[204,192],"locked":1,"volatile":1,"scale":1}

{script:colclosest.0}
on view do
 a:col.from_hex[hex.text]
 p:range col.cssnames
 k:keys col.cssnames
 css.text:k[col.closest[a p]]

 patterns[42]:col.from_hex[hex.text]
 patterns[43]:col.from_css[css.text]
 p1.clear[]
 p1.paste[p1.copy[].map[0 dict 42]]
 p2.clear[]
 p2.paste[p2.copy[].map[0 dict 43]]
end
{end}

{card:importoverview}
image:"%%[encoded data, 29196 characters]"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"Image Import: Overview"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,238],"pos":[254,48],"locked":1,"border":0,"value":"By default, importing images into Decker will convert them to black and white (patterns 1 and 0) using an error-diffusion algorithm invented by Bill Atkinson to \"dither\" between these colors, producing the impression of a grayscale image. The J and K keys or \"Edit -> Lighten Image / Darken Image\" can be used to adjust the contrast of such an image while the selection remains active.\n\nIf Decker is in \"color\" mode (with any drawing tool active, \"Style -> Color\" from the menu) importing images will instead \"posterize\" them to 16 colors based on Decker's current palette.\n\nIt is possible to obtain higher-quality results by dithering images to 16 colors using external tools. There are many choices and tradeoffs necessary in this process depending upon your aesthetic needs and preferences.\n\nOn the next few cards we'll review several tools and considerations."}

{card:importpal}
image:"%%[encoded data, 6720 characters]"
{widgets}
field1:{"type":"field","size":[224,265],"pos":[278,48],"locked":1,"border":0,"value":{"text":["Before we consider importing color images, we may want to customize Decker's 16-color palette.\n\nIf you locate a 14- or 16-color palette you like on ","lospec.com"," and download a .hex file for that palette, you can drag and drop it onto the Decker window to apply it. A 14-color palette will leave black and white intact, while a 16-color palette will cause Decker to pick its best guess for a replacement \"black\" and \"white\".\n\nAlternatively, you could use a tool like the PalImport contraption to the left to give yourself more control; it consumes the same .hex format, but provides you with the opportunity to edit or reorder individual colors by hand. Try applying the example palette in the PalImport contraption for some nice warm earthtones! If you want even more control, consider building a custom contraption of your own using PalImport as a starting point.\n\nYou can also use the Font/DA Mover to import the patterns resource from other existing decks, or to delete your deck's patterns and reset them to the defaults."],"font":["","",""],"arg":["","https://lospec.com/palette-list",""]}}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"Image Import: Palettes"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
button4:{"type":"button","size":[126,20],"pos":[84,269],"script":"importpal.0","text":"Reset To Default"}
palImport1:{"type":"contraption","size":[137,100],"pos":[78,143],"def":"palImport","widgets":{"button1":{},"button2":{},"p":{"value":"2e222f\n45293f\n7a3045\n993d41\ncd683d\nfbb954\nf2ec8b\nb0a987\n997f73\n665964\n443846\n576069\n788a87\na9b2a2\n"}}}
field:{"type":"field","size":[56,15],"pos":[70,126],"locked":1,"border":0,"align":"center","value":"palImport"}

{script:importpal.0}
on click do
 reset_pal[]
end
{end}

{card:importread}
image:"%%[encoded data, 9676 characters]"
script:"thepalette.0"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"Image Import: read[]"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,157],"pos":[254,48],"locked":1,"border":0,"value":"The read[] built-in function can be used to import image files in a .PNG, .JPEG, .BMP, or .GIF format and produce an Image Interface.\n\nBy default, read[\"image\"] will read an image file in a 16-color format, converting each pixel in the image to the closest entry in Decker's current palette, producing a \"posterized\" effect, as seen on the left.\n\nIt's also possible to specify a second \"hint\" argument to read[] in order to ask it to decode the image into 256 shades of gray (which cannot be directly displayed on a card, but can be manipulated by scripts), to decode the frames of an animated .GIF, or both. See Decker's reference manual for more detail."}
target:{"type":"button","size":[186,201],"pos":[34,71],"show":"none"}
ex1:{"type":"field","size":[248,51],"pos":[254,214],"style":"code","value":"card.image.paste[\n read[\"image\"]\n target.pos,target.size\n]"}
button4:{"type":"button","size":[60,20],"pos":[348,273],"script":"patternsanimation.0","text":"Try It!"}
field2:{"type":"field","size":[62,14],"pos":[34,54],"locked":1,"border":0,"value":"target"}

{card:importditherit}
image:"%%[encoded data, 69424 characters]"
{widgets}
button1:{"type":"button","size":[60,20],"pos":[442,312],"script":"logicalcolor.0","text":"Next","style":"rect"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"Image Import: DitherIt"}
button3:{"type":"button","size":[60,20],"pos":[78,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,217],"pos":[254,48],"locked":1,"border":0,"value":{"text":["There are a variety of algorithms for \"dithering\" color images down to a 16-color palette, and many external tools for the job.\n\n","DitherIt"," is a convenient online tool with many useful options. Make sure you configure it to work with Decker's palette and select an appropriate output size: resizing images AFTER dithering them reduces their quality considerably. Decker's default card size is 512x324 pixels.\n\n\n\n\n\n\n\n\nObserve how much more detail can be preserved by importing a 16-color image of Pippi which has been dithered first!"],"font":["","",""],"arg":["","https://ditherit.com",""]}}
target:{"type":"button","size":[186,201],"pos":[34,71],"show":"none"}
button5:{"type":"button","size":[217,39],"pos":[272,170],"script":"importditherit.0","text":"Get Decker's Palette\nin DitherIt JSON Format"}

{script:importditherit.0}
on click do
 p:"%j" format list range each c in colors
  r.hex:"#%06H" format patterns[c]
 end
 alert["copy and paste the below JSON:" "string" p]
end
{end}

{card:card1}
image:"%%[encoded data, 56208 characters]"
{widgets}
field3:{"type":"field","size":[182,37],"pos":[36,274],"locked":1,"border":0,"align":"center","value":"ordered dithers usually don't look as nice as an error-diffusion method. imagemagick can do both!"}
button2:{"type":"button","size":[60,20],"pos":[10,312],"script":"logicalcolor.0","text":"Prev","style":"rect"}
title:{"type":"field","size":[492,17],"pos":[10,22],"locked":1,"font":"menu","show":"invert","border":1,"align":"center","value":"Image Import: ImageMagick"}
button3:{"type":"button","size":[60,20],"pos":[441,312],"script":"logicalcolor.0","text":"Index","style":"rect"}
field1:{"type":"field","size":[248,174],"pos":[254,48],"locked":1,"border":0,"value":{"text":["If you're bulk-converting many images, you may wish to consider a command-line tool like ","ImageMagick"," for performing dithering.\n\nImageMagick also requires a reference palette; the easiest way to supply it is as an image with one pixel of each color in the palette:\n\n\n\n\n\n\n\nA command line sequence to perform a different \"ordered dither\" technique with ImageMagick might look something like the following:"],"font":["","",""],"arg":["","https://imagemagick.org/index.php",""]}}
target:{"type":"button","size":[186,201],"pos":[34,71],"show":"none"}
button5:{"type":"button","size":[217,39],"pos":[273,133],"script":"card1.0","text":"Save Decker's Palette as\n\"lut.gif\" for ImageMagick"}
field2:{"type":"field","size":[248,44],"pos":[254,234],"style":"code","value":"$convert pippibust.jpg -resize 186x201 -brightness-contrast -10 -ordered-dither o4x4 -remap lut.gif ordered.gif"}

{script:card1.0}
on click do
 r:image[16,1]
 each c k i in colors r[i,0]:c end
 write[r "lut.gif"]
end
{end}

{card:beacon}
image:"%%[encoded data, 36980 characters]"
{widgets}
pal:{"type":"field","size":[206,34],"pos":[295,31],"locked":1,"show":"none","value":"[16777215,2375497,2238779,3429956,7044956,11579772,14796164,13145696,11362130,9516598,6893329,8999983,7958115,10583390,11837839,0]"}
button1:{"type":"button","size":[97,29],"pos":[403,301],"script":"beacon.0","text":"Back"}
field1:{"type":"field","size":[171,34],"pos":[8,299],"locked":1,"align":"center","value":{"text":["this is a background from ","ahmwma","'s \"Beacon Puzzle\" prototype,\nused with permission."],"font":["","",""],"arg":["","https://ahmwma.itch.io",""]}}
button2:{"type":"button","size":[33,34],"pos":[109,48],"script":"beacon.1","show":"transparent","style":"invisible"}
button3:{"type":"button","size":[20,25],"pos":[317,76],"script":"beacon.2","show":"transparent","style":"invisible"}
button4:{"type":"button","size":[20,25],"pos":[292,75],"script":"beacon.3","show":"transparent","style":"invisible"}
button5:{"type":"button","size":[30,34],"pos":[302,105],"script":"beacon.4","show":"transparent","style":"invisible"}
button6:{"type":"button","size":[11,18],"pos":[344,127],"script":"beacon.5","show":"transparent","style":"invisible"}
button7:{"type":"button","size":[89,189],"pos":[361,40],"script":"beacon.6","show":"transparent","style":"invisible"}

{script:beacon.0}
on click do
 go["Back" "BoxOut" 15]
 reset_pal[]
 go["Back" "BoxIn" 15]
end
{end}

{script:beacon.1}
on click do
 alert["There are two tiny figures playing together inside this snow globe."]
 alert["One looks like an exposition fairy, and the other is some kind of lion/eagle chimera... or maybe a cat/chicken chimera?"]
 alert["You feel an urge to shake the snow globe,\nbut... you probably shouldn't."]
end
{end}

{script:beacon.2}
on click do
 alert["What a nice bug.\nYou don't see these around as often anymore..."]
end
{end}

{script:beacon.3}
on click do
 alert["Someone just scribbed two lines\nand a dot here."]
end
{end}

{script:beacon.4}
on click do
 alert["It's some kind of memo\nabout 'boyrap premium'.\n I have no idea what that means."]
end
{end}

{script:beacon.5}
on click do
 alert["This light switch is glued in the 'ON' position."]
end
{end}

{script:beacon.6}
on click do
 alert["Brr. No way.\nIt's too cold outside."]
end
{end}

{card:black}
image:"%%IMG2AgABVgH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/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af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8B/wH/Af8Brg=="

{module:col}
description:"color manipulation utilities"
version:1
{data}
cssnames:{"black":0,"silver":12632256,"gray":8421504,"white":16777215,"maroon":8388608,"red":16711680,"purple":8388736,"fuchsia":16711935,"green":32768,"lime":65280,"olive":8421376,"yellow":16776960,"navy":128,"blue":255,"teal":32896,"aqua":65535,"orange":16753920,"aliceblue":15792383,"antiquewhite":16444375,"aquamarine":8388564,"azure":15794175,"beige":16119260,"bisque":16770244,"blanchedalmond":16772045,"blueviolet":9055202,"brown":10824234,"burlywood":14596231,"cadetblue":6266528,"chartreuse":8388352,"chocolate":13789470,"coral":16744272,"cornflowerblue":6591981,"cornsilk":16775388,"crimson":14423100,"cyan":65535,"darkblue":139,"darkcyan":35723,"darkgoldenrod":12092939,"darkgray":11119017,"darkgreen":25600,"darkgrey":11119017,"darkkhaki":12433259,"darkmagenta":9109643,"darkolivegreen":5597999,"darkorange":16747520,"darkorchid":10040012,"darkred":9109504,"darksalmon":15308410,"darkseagreen":9419919,"darkslateblue":4734347,"darkslategray":3100495,"darkslategrey":3100495,"darkturquoise":52945,"darkviolet":9699539,"deeppink":16716947,"deepskyblue":49151,"dimgray":6908265,"dimgrey":6908265,"dodgerblue":2003199,"firebrick":11674146,"floralwhite":16775920,"forestgreen":2263842,"gainsboro":14474460,"ghostwhite":16316671,"gold":16766720,"goldenrod":14329120,"greenyellow":11403055,"grey":8421504,"honeydew":15794160,"hotpink":16738740,"indianred":13458524,"indigo":4915330,"ivory":16777200,"khaki":15787660,"lavender":15132410,"lavenderblush":16773365,"lawngreen":8190976,"lemonchiffon":16775885,"lightblue":11393254,"lightcoral":15761536,"lightcyan":14745599,"lightgoldenrodyellow":16448210,"lightgray":13882323,"lightgreen":9498256,"lightgrey":13882323,"lightpink":16758465,"lightsalmon":16752762,"lightseagreen":2142890,"lightskyblue":8900346,"lightslategray":7833753,"lightslategrey":7833753,"lightsteelblue":11584734,"lightyellow":16777184,"limegreen":3329330,"linen":16445670,"magenta":16711935,"mediumaquamarine":6737322,"mediumblue":205,"mediumorchid":12211667,"mediumpurple":9662683,"mediumseagreen":3978097,"mediumslateblue":8087790,"mediumspringgreen":64154,"mediumturquoise":4772300,"mediumvioletred":13047173,"midnightblue":1644912,"mintcream":16121850,"mistyrose":16770273,"moccasin":16770229,"navajowhite":16768685,"oldlace":16643558,"olivedrab":7048739,"orangered":16729344,"orchid":14315734,"palegoldenrod":15657130,"palegreen":10025880,"paleturquoise":11529966,"palevioletred":14381203,"papayawhip":16773077,"peachpuff":16767673,"peru":13468991,"pink":16761035,"plum":14524637,"powderblue":11591910,"rosybrown":12357519,"royalblue":4286945,"saddlebrown":9127187,"salmon":16416882,"sandybrown":16032864,"seagreen":3050327,"seashell":16774638,"sienna":10506797,"skyblue":8900331,"slateblue":6970061,"slategray":7372944,"slategrey":7372944,"snow":16775930,"springgreen":65407,"steelblue":4620980,"tan":13808780,"thistle":14204888,"tomato":16737095,"turquoise":4251856,"violet":15631086,"wheat":16113331,"whitesmoke":16119285,"yellowgreen":10145074,"rebeccapurple":6697881}
{script}

# lookup tables:

local hsv_comps:"%j" parse "[[0,1,2],[3,0,2],[2,0,1],[2,3,0],[1,2,0],[0,2,3]]"
local rgb_comps:2^(16,8,0)
local hex_comps:0,0,1,1,2,2

# convert packed rgb into various formats:

module.to_comp:on to_comp x do
 256%floor x/rgb_comps
end
module.to_hsv:on to_hsv x do
 x:"rgb" dict to_comp[x]/255
 local maxc:max x
 local minc:min x
 if minc~maxc
  0,0,maxc
 else
  local s:(maxc-minc)/maxc
  local c:(maxc-x   )/maxc-minc
  local h:if x.r~maxc 0.0+c.b-c.g
  elseif     x.g~maxc 2.0+c.r-c.b
  else                4.0+c.g-c.r end
  (1%h/6),(s),(maxc)
 end
end
module.to_hex:on to_hex x do
 "%02H%02H%02H" format to_comp[x]
end
module.to_css:on to_css x do
 "#%02H%02H%02H" format to_comp[x]
end

# convert various formats into packed rgb:

module.from_comp:on from_comp x do
 sum rgb_comps*floor 255&0|x
end
module.from_hsv:on from_hsv x do
 x:"hsv" dict (1%first x),0|1&1 drop x
 local i:floor 6*x.h
 local f:(6*x.h)-i
 local c:x.v,x.v*1-(x.s*1-f),(x.s),(f*x.s)
 from_comp[255*c@hsv_comps[6%i]]
end
module.from_hex:on from_hex x do
 if 6>count x x:"" fuse x @ hex_comps end
 from_comp["%02H%02H%02H" parse x]
end
module.from_css:on from_css x do
 if "#"~first x
  from_hex[1 drop x]
 elseif "rgb"~3 take x # do not support alpha channel, hsl(), hwb(), lab(), lch(), color(), etc.
  on perc x do floor if "%"~last x 255*x/100 else 0+x end end
  c:"rgb%*oa(%.12r0123456789.%%*r %*o,%*r %.12r0123456789.%%*r %*o,%*r %.12r0123456789.%" parse x
  from_comp[perc @ c]
 else
  data.cssnames[x]
 end
end

# utilities

module.closest:on closest x pal do
 local n:to_comp[x]
 local h:to_comp@if "patterns"~typeof pal pal@32+range 16 else pal end
 local ri:0
 on color_dist x do sum (n-x)^2 end
 each v i in h
  if color_dist[v]<color_dist[h[ri]] ri:i end
 end
 if "patterns"~typeof pal 32+ri else ri end
end
module.cssnames:data.cssnames

{end}

{contraption:palImport}
size:[137,100]
margin:[0,0,0,0]
description:"a tool for importing color palettes in the .hex format as used by lospec.com."
image:"%%IMG2AIkAZAACAYUAAwEBDYUBAQABAQENhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQINhwECDYcBAg2HAQEAAQEBDYUBAQADAYUAAg=="
{widgets}
button1:{"type":"button","size":[60,20],"pos":[6,74],"script":"palImport.0p","text":"Import"}
button2:{"type":"button","size":[60,20],"pos":[71,74],"script":"palImport.1p","text":"Apply"}
p:{"type":"field","size":[125,62],"pos":[6,7],"scrollbar":1,"style":"code"}

{script:palImport.0p}
on click do
 p.text:read[]
end
{end}

{script:palImport.1p}
on color_dist a b do
 aa:"%2h%2h%2h" parse "%06h" format a
 bb:"%2h%2h%2h" parse "%06h" format b
 sum(aa-bb)^2
end

on find_closest i n do
 g:patterns[i]
 r:first n
 each v in n
  if color_dist[r g]>color_dist[v g] r:v end
 end
 patterns[i]:r
 (list r) drop n
end

on click do
 n:16 limit (list "%h") parse "\n" split p.text
 patterns[32]:16777215
 patterns[47]:0
 if (count n)>15
  n:find_closest[32 n]
  n:find_closest[47 n]
 end
 each c i in n patterns[33+i]:c end
end
{end}

