DIRECTORY Basics, Buttons, CD, CDColors, CDIO, CDMenus, CDSequencer, NMos, Commander, Containers, Convert, Imager, ImagerColorMap, ImagerDitherContext, ImagerTerminal, InterminalBackdoor, Icons, Labels, MessageWindow, Process, Real, Rope, Sliders, Terminal, TerminalIO, UserProfile, ViewerOps, ViewerClasses, ViewerPrivate, WindowManager; NMos8BitColors: CEDAR PROGRAM IMPORTS Basics, Buttons, CDColors, CDIO, CDMenus, CDSequencer, NMos, Commander, Containers, Convert, Icons, ImagerColorMap, ImagerDitherContext, ImagerTerminal, InterminalBackdoor, Labels, MessageWindow, Process, Real, Rope, Sliders, Terminal, TerminalIO, UserProfile, ViewerOps, ViewerPrivate, WindowManager = BEGIN terminal: Terminal.Virtual _ InterminalBackdoor.terminal; useMapEntries: ImagerDitherContext.MapEntries _ NIL; ContextCreator: ViewerPrivate.ContextCreatorProc = BEGIN context: Imager.Context; SELECT screen FROM bw => context _ ImagerTerminal.BWContext[vt: terminal, pixelUnits: TRUE]; color => { context _ ImagerTerminal.ColorContext[vt: terminal, pixelUnits: TRUE]; IF useMapEntries#NIL THEN ImagerDitherContext.SetDitherMap[context, useMapEntries]; [] _ Terminal.SetColorCursorPresentation[terminal, onesAreWhite]; } ENDCASE => ERROR; RETURN [context] END; ForceColors: PROC [mapEntries: ImagerDitherContext.MapEntries] = BEGIN useMapEntries _ mapEntries; ImagerColorMap.LoadEntries[vt: terminal, mapEntries: mapEntries, gamma: 1, shared: FALSE]; [] _ Terminal.SetColorCursorPresentation[terminal, onesAreWhite]; [] _ ViewerPrivate.SetCreator[ContextCreator]; END; CallMenu: Buttons.ButtonProc = BEGIN comm: REF READONLY CDSequencer.CommDescriptor _ CDSequencer.FetchCommand[$ColorDisplayMenuC, technology]; IF comm#NIL AND comm.p#NIL THEN comm.p[NIL]; END; ColorRec: TYPE = RECORD[r, g, b, w: REAL _ 0, name: Rope.ROPE _ NIL]; ColorDescRep: TYPE = ARRAY [0..numberOfColors) OF ColorRec; Exception: TYPE = RECORD [x: CARDINAL, c: ColorRec, replace: BOOL _ TRUE]; technology: CD.Technology _ NMos.nmos; technologyName: Rope.ROPE _ technology.name; numberOfColors: INT = 7; --background, normal colors and extra colors numberOfNormalColors: INT = 5; --without background and extra colors cDefaults: REF ColorDescRep _ NEW[ColorDescRep _ [ [0.49, 0.62, 0.62, 0.05, "Sub"], --background [0, 1, 0, 1, "dif"], [1, 1, 0.2, 0.20, "imp"], [0.5, 0.5, 1, 0.5, "m1"], [0.7, 0.4, 0.7, 0.4, "m2"], [1, 0.2, 0, 1, "pol"], [1, 0.95, 0.0, 0.9, "Xx"] --channel hack ]]; channelX: INT _ 6; SetupSpecials: PROC [] = BEGIN cc: ColorRec _ currentColor[channelX]; --channel hack x: INT _ channelX+1; specials1 _ LIST[ [x: 1+16, c: [cc.r, cc.g, -cc.b, x*cc.w-1], replace: FALSE] --yellow on transistor ]; specials2 _ NIL; specials3 _ LIST[ [x: 127, c: [0, 0, 0, 1], replace: TRUE], --black for cuts [x: 243, c: [1, 0, 0, 1]], --get all nice colors back for other users [x: 245, c: [0, 0, 1, 1]], [x: 247, c: [0, 1, 0, 1]], [x: 249, c: [0, 1, 1, 1]], [x: 250, c: [1, 0, 1, 1]], [x: 251, c: [1, 1, 0, 1]], [x: 252, c: [1, 1, 1, 1]], [x: 254, c: [0, 0, 0, 1]], IF whiteOutLine THEN Exception[x: 255, c: [1, 1, 1, 1]] ELSE Exception[x: 255, c: [0, 0, 0, 1]] --all bits set ]; END; Init8Patterns: Buttons.ButtonProc = BEGIN green1: CARDINAL = 1; yellow: CARDINAL = 2; blue: CARDINAL = 4; pinktr: CARDINAL = 8; red: CARDINAL = 16; black: CARDINAL = 127; Checker8: PROC[col1, col2: CARDINAL] RETURNS[REF CDColors.Brick] = BEGIN RETURN[NEW[CDColors.Brick _ [col1*256+col2, col2*256+col1, col1*256+col2, col2*256+col1]]] END; DefineDimmer8: PROC[lev: CD.Layer, color: CARDINAL] = BEGIN CDColors.DefineColor[lev, Checker8[color, 0], bit8, pushedOut]; END; Full8: PROC[color: CARDINAL] RETURNS [b: REF CDColors.Brick] = BEGIN RETURN[Checker8[color, color]] END; CDColors.DefineColor[NMos.dif, Full8[green1], bit8]; CDColors.DefineColor[NMos.met, Full8[blue], bit8]; CDColors.DefineColor[NMos.met2, Full8[pinktr], bit8]; CDColors.DefineColor[NMos.pol, Full8[red], bit8]; CDColors.DefineColor[NMos.cut, Full8[black], bit8]; CDColors.DefineColor[NMos.imp, Full8[yellow], bit8]; CDColors.DefineColor[NMos.imp0, Checker8[yellow, 0], bit8]; CDColors.DefineColor[NMos.impWeak, Checker8[yellow, 0], bit8]; CDColors.DefineColor[NMos.cut2, Checker8[black, blue], bit8]; CDColors.DefineColor[NMos.bur, Checker8[black, 0], bit8]; CDColors.DefineColor[NMos.ovg, Checker8[blue, pinktr], bit8]; CDColors.DefineColor[CD.backGround, NEW[CDColors.Brick _ [8, 0, 256*8, 0]], bit8]; CDColors.DefineColor[CD.highLightError, NEW[CDColors.Brick _ [255, 0, 0, 0]], bit8]; CDColors.DefineColor[CD.highLightShade, NEW[CDColors.Brick_[0, 255,0 , 255]], bit8]; DefineDimmer8[NMos.dif, green1]; DefineDimmer8[NMos.met, blue]; DefineDimmer8[NMos.met2, pinktr]; DefineDimmer8[NMos.pol, red]; DefineDimmer8[NMos.imp, yellow]; DefineDimmer8[NMos.cut, black]; DefineDimmer8[NMos.cut2, black]; END; whiteOutLine: BOOL; currentColor: REF ColorDescRep = NEW[ColorDescRep]; curLayer: INT _ 1; prevLayer: INT _ 1; -- to deselect the previous layer button CoefSlider: TYPE = RECORD [ value: Labels.Label _ NIL, select: Buttons.Button _ NIL, bar: Sliders.Slider _ NIL ]; ColorSlider: TYPE = RECORD [ value: Labels.Label _ NIL, bar: Sliders.Slider _ NIL ]; Handle: TYPE = REF AdjustColorRec; AdjustColorRec: TYPE = RECORD [ outer: Containers.Container _ NIL, coefLayer: ARRAY [0..numberOfColors) OF CoefSlider, potarColor: ARRAY [0..3) OF ColorSlider, height: CARDINAL _ 0 -- height measured from the top of the container ]; DataForSpecialProc: TYPE = REF DataForSpecialProcRec; DataForSpecialProcRec: TYPE = RECORD [ my: Handle, layer: CARDINAL ]; caption: Rope.ROPE = Rope.Concat[technologyName, " 8 bit color editor"]; ColorModeIs8: PROC [] RETURNS [BOOL] = INLINE BEGIN RETURN [terminal.hasColorDisplay AND ~terminal.GetColorMode[].full AND terminal.GetColorMode[].bitsPerPixelChannelA=8]; END; Check8BitMode: PROC [] RETURNS [ok: BOOL] = BEGIN ok _ ColorModeIs8[]; IF ~ok THEN TRUSTED{Process.Detach[FORK TerminalIO.WriteRope["Put the display in 8 bit per pixel mode first\n"]]}; END; UpdateWeightSlider: Sliders.SliderProc = BEGIN datac: DataForSpecialProc _ NARROW[clientData]; my: Handle _ datac.my; layer: CARDINAL _ datac.layer; IF ~ColorModeIs8[] THEN RETURN; currentColor[layer].w _ value; ComputeColors[]; Labels.Set[my.coefLayer[layer].value, Convert.RopeFromInt[Real.Fix[value*100]]]; END; UpdateColorSlider: Sliders.SliderProc = BEGIN data: DataForSpecialProc _ NARROW[clientData]; my: Handle _ data.my; layer: CARDINAL _ data.layer; IF ~ColorModeIs8[] THEN RETURN; Labels.Set[my.potarColor[layer].value, Convert.RopeFromInt[Real.Fix[value*100]]]; SELECT layer FROM 0 => currentColor[curLayer-1].r _ value; 1 => currentColor[curLayer-1].g _ value; 2 => currentColor[curLayer-1].b _ value; ENDCASE => ERROR; ComputeColors[]; END; ResetButton: Buttons.ButtonProc = BEGIN Init8Patterns[parent: parent, clientData: clientData]; ResetMapButton[parent: parent, clientData: clientData]; END; XSelection: Buttons.ButtonProc = BEGIN whiteOutLine _ ~whiteOutLine; ComputeColors[]; END; ResetAndCreateButton: Buttons.ButtonProc = BEGIN viewer: ViewerClasses.Viewer _ ViewerOps.FindViewer[caption]; IF viewer=NIL THEN { IF mouseButton=yellow THEN CallMenu[NIL] ELSE { IF Terminal.LegalColorMode[terminal, [FALSE, 8, 0]] AND ~ColorModeIs8[] THEN { pos: WindowManager.ScreenPos _ left; IF Rope.Equal["right", UserProfile.Token[key: "ColorDisplay.Side"], FALSE] THEN pos _ right; WindowManager.StartColorViewers[screenPos: pos, bitsPerPixel: 8]; }; ResetButton[parent: parent]; IF mouseButton=blue THEN CreateAnInstance[]; } } ELSE { IF viewer.iconic THEN ViewerOps.OpenIcon[viewer] ELSE MessageWindow.Append["use the color editor tool", TRUE]; }; END; ResetMapButton: Buttons.ButtonProc = BEGIN UpdateAllSliders: PROC [my: Handle] = BEGIN w: Sliders.NormalizedSliderValue; IF my=NIL OR my.outer=NIL OR my.outer.destroyed THEN RETURN; FOR layer: INT IN [0..numberOfColors) DO w _ currentColor[layer].w; Sliders.SetContents[my.coefLayer[layer].bar, 0]; Sliders.SetContents[my.coefLayer[layer].bar, w]; Labels.Set[my.coefLayer[layer].value, Convert.RopeFromInt[Real.Fix[currentColor[layer].w*100]]]; ENDLOOP; ButtonProcLayerInternal[0, my]; END; IF Check8BitMode[] THEN { ReadProfileColors[]; ComputeColors[]; IF clientData#NIL THEN UpdateAllSliders[NARROW[clientData, Handle]]; }; END; ButtonProcLayer: Buttons.ButtonProc = BEGIN data: DataForSpecialProc _ NARROW[clientData]; IF Check8BitMode[] THEN { ButtonProcLayerInternal[data.layer, data.my]; } END; ButtonProcLayerInternal: PROC[layer: CARDINAL, my: Handle] = BEGIN SetPotar: PROC[layer: CARDINAL, my: Handle] = BEGIN Sliders.SetContents[my.potarColor[0].bar, currentColor[layer].r]; Sliders.SetContents[my.potarColor[1].bar, currentColor[layer].g]; Sliders.SetContents[my.potarColor[2].bar, currentColor[layer].b]; Labels.Set[my.potarColor[0].value, Convert.RopeFromInt[Real.Fix[currentColor[layer].r*100]]]; Labels.Set[my.potarColor[1].value, Convert.RopeFromInt[Real.Fix[currentColor[layer].g*100]]]; Labels.Set[my.potarColor[2].value, Convert.RopeFromInt[Real.Fix[currentColor[layer].b*100]]]; END; curLayer _ layer+1; SetPotar[layer, my]; Buttons.SetDisplayStyle[my.coefLayer[prevLayer-1].select, $BlackOnWhite]; Buttons.SetDisplayStyle[my.coefLayer[curLayer-1].select, $WhiteOnBlack]; prevLayer _ curLayer; END; CreateAnInstance: PROC[] = BEGIN nameColorSlider: ARRAY [0..3) OF Rope.ROPE _ ["R", "G", "B"]; coefX: CARDINAL = 10; coefDX: CARDINAL = 25; coefDeltaX: CARDINAL = coefDX+4; coefSelectY: CARDINAL = 3; coefSelectDY: CARDINAL = 15; coefValueY: CARDINAL = coefSelectY+coefSelectDY+3; coefValueDY: CARDINAL = 15; coefBarY: CARDINAL = coefValueY+coefValueDY; firstButtonY: CARDINAL = 3; buttonX: CARDINAL = coefX+numberOfColors*coefDeltaX+8; buttonDX: CARDINAL = 80; firstSliderY: CARDINAL = 6; sliderDY: CARDINAL = 22; interSliderY: CARDINAL = 6; labelX: CARDINAL = buttonX+buttonDX+10; -- R, G, B labelDX: CARDINAL = 14; label2X: CARDINAL = labelX+labelDX; -- number label2DX: CARDINAL = 30; sliderX: CARDINAL = label2X+label2DX; my: Handle = NEW[AdjustColorRec]; buttonWy: CARDINAL _ firstButtonY; NextButton: PROC [name: Rope.ROPE, proc: Buttons.ButtonProc] = BEGIN buttonDY: CARDINAL = 15; interButtonY: CARDINAL = 2; [] _ Buttons.Create[ info: [name: name, wx: buttonX, wy: buttonWy, wh: buttonDY, ww: buttonDX, parent: my.outer, border: TRUE], proc: proc, clientData: my, fork: TRUE ]; buttonWy _ buttonWy+buttonDY+interButtonY; END; IF ~ColorModeIs8[] THEN TerminalIO.WriteRope["The 8 bit color tool works only after setting the display in 8 bit mode\n"]; IF ViewerOps.FindViewer[caption]#NIL THEN { TerminalIO.WriteRope[caption]; TerminalIO.WriteRope[" viewer already exits\n"]; RETURN }; my.outer _ Containers.Create[[ name: caption, iconic: TRUE, icon: Icons.NewIconFromFile[CDIO.GetWorkingDirectory[NIL].Cat["Chipndale.icons"], 2], column: left, scrollable: FALSE ]]; my.height _ firstSliderY+3*(sliderDY+interSliderY); FOR curLayer: INT IN [0..numberOfColors) DO wInit: REAL _ currentColor[curLayer].w; my.coefLayer[curLayer].select _ Buttons.Create[ info: [ name: cDefaults[curLayer].name, iconic: TRUE, wx: coefX+curLayer*coefDeltaX, wy: coefSelectY, wh: coefSelectDY, ww: coefDX, parent: my.outer, border: TRUE], proc: ButtonProcLayer, clientData: NEW[DataForSpecialProcRec _ [my: my, layer: curLayer]] ]; my.coefLayer[curLayer].value _ Labels.Create[ [ name: Convert.RopeFromInt[Real.Fix[wInit*100]], -- initial contents iconic: TRUE, wx: coefX+curLayer*coefDeltaX, wy: coefValueY, wh: coefValueDY, ww: coefDX, parent: my.outer, border: TRUE ]]; my.coefLayer[curLayer].bar _ Sliders.Create[ info: [ name: cDefaults[curLayer].name, iconic: TRUE, parent: my.outer, wx: coefX+curLayer*coefDeltaX, wy: coefBarY, wh: -5, --guardY ww: coefDX, border: TRUE], sliderProc: UpdateWeightSlider, orientation: vertical, value: wInit, clientData: NEW[DataForSpecialProcRec _ [my: my, layer: curLayer] ]]; Containers.ChildYBound[my.outer, my.coefLayer[curLayer].bar]; ENDLOOP; NextButton["reset all", ResetButton]; NextButton["reset map", ResetMapButton]; NextButton["reset pattern", Init8Patterns]; NextButton["X Selection", XSelection]; NextButton["Menu", CallMenu]; FOR iColor: CARDINAL IN [0..3) DO cInit: REAL _ SELECT iColor FROM 0 => currentColor[curLayer-1].r, 1 => currentColor[curLayer-1].g, 2 => currentColor[curLayer-1].b, ENDCASE => ERROR; [] _ Labels.Create[ info: [name: nameColorSlider[iColor], parent: my.outer, wx: labelX, wy: firstSliderY+iColor*(sliderDY+interSliderY), ww: labelDX, wh: sliderDY, border: TRUE ]]; my.potarColor[iColor].bar _ Sliders.Create[ info: [parent: my.outer, wx: sliderX, wy: firstSliderY+iColor*(sliderDY+interSliderY), ww: 10, wh: sliderDY], sliderProc: UpdateColorSlider, orientation: horizontal, value: cInit, clientData: NEW[DataForSpecialProcRec _ [my: my, layer: iColor]] ]; Containers.ChildXBound[my.outer, my.potarColor[iColor].bar]; my.potarColor[iColor].value _ Labels.Create[[ name: Convert.RopeFromInt[Real.Fix[cInit*100]], -- initial contents wx: label2X, wy: firstSliderY+iColor*(sliderDY+interSliderY), ww: label2DX, wh: sliderDY, parent: my.outer, border: TRUE ]]; ENDLOOP; ViewerOps.SetOpenHeight[my.outer, my.height]; -- hint our desired height ViewerOps.PaintViewer[my.outer, all]; -- reflect above change Buttons.SetDisplayStyle[my.coefLayer[0].select, $WhiteOnBlack]; END; SaturationComm: CDSequencer.CommandProc = BEGIN sat: CARDINAL _ 1; IF Check8BitMode[] THEN { list: LIST OF Rope.ROPE _ LIST["from profile"]; FOR i: INT DECREASING IN [0..numberOfColors) DO list _ CONS[cDefaults[i].name, list] ENDLOOP; curLayer _ TerminalIO.RequestSelection[label: "Layers", choice: list]; IF curLayer=0 THEN RETURN[]; IF curLayer<=numberOfColors THEN { sat _ TerminalIO.RequestSelection[ label: "Values", choice: LIST["Invisible", "1", "2", "3", "4", "5", "6", "7", "8", "9", "Saturated"] ]; IF sat = 0 THEN RETURN[]; currentColor[curLayer-1].w _ Real.Float[sat-1]/10; } ELSE ReadProfileColors[]; ComputeColors[]; }; END; specials1: LIST OF Exception _ NIL; --specials in the range of stipples [use for any comb] specials2: LIST OF Exception _ NIL; --specials in the range of stipples [use for exact comb] specials3: LIST OF Exception _ NIL; --specials to be considered later ComputeColors: PROC[] = BEGIN ComposeColor: PROC[c1, wc2: ColorRec] RETURNS [c: ColorRec] = INLINE BEGIN w: REAL _ wc2.w; c _ [c1.r+w*wc2.r, c1.g+w*wc2.g, c1.b+w*wc2.b, c1.w+w] END; SetMap: PROC[index: CARDINAL, color: ColorRec] = BEGIN RtoC: PROC [r: REAL] RETURNS [c: [0..256)] = INLINE { c _ MAX[0, MIN[255, Real.RoundI[r*255]]] }; mapEntrie: ImagerColorMap.MapEntry _ [index, RtoC[color.r], RtoC[color.g], RtoC[color.b]]; mapEntries _ CONS[mapEntrie, mapEntries]; END; mapEntries: LIST OF ImagerColorMap.MapEntry _ NIL; c: ColorRec; bits: CARDINAL _ numberOfNormalColors; power: CARDINAL _ Basics.BITSHIFT[1, bits]; IF ~ColorModeIs8[] THEN RETURN; SetupSpecials[]; FOR i: CARDINAL IN [0..power) DO c _ [0, 0, 0, 0]; FOR bit: CARDINAL IN [0..bits) DO IF Basics.BITAND[i, Basics.BITSHIFT[1, bit]]#0 THEN { c _ ComposeColor[c, currentColor[bit+1]]; }; ENDLOOP; FOR list: LIST OF Exception _ specials1, list.rest WHILE list#NIL DO IF Basics.BITAND[i, list.first.x]=list.first.x THEN { IF list.first.replace THEN c _ list.first.c ELSE c _ ComposeColor[c, list.first.c]; }; ENDLOOP; FOR list: LIST OF Exception _ specials2, list.rest WHILE list#NIL DO IF i=list.first.x THEN { IF list.first.replace THEN c _ list.first.c ELSE c _ ComposeColor[c, list.first.c]; }; ENDLOOP; IF c.w<0.2 THEN c _ ComposeColor[c, currentColor[0]]; IF c.w=0 THEN c _ currentColor[0] ELSE c _ [c.r/c.w, c.g/c.w, c.b/c.w, 0]; SetMap[i, c]; ENDLOOP; FOR list: LIST OF Exception _ specials3, list.rest WHILE list#NIL DO IF list.first.x>=power THEN SetMap[list.first.x, list.first.c]; ENDLOOP; ForceColors[mapEntries: mapEntries]; END; ReadProfileColors: PUBLIC PROC [] = BEGIN DefaultColor: PROC [def: ColorRec] RETURNS [c: ColorRec] = BEGIN r: Rope.ROPE _ Rope.Cat["ChipNDale.", technologyName, ".", def.name]; c.w _ Real.Float[UserProfile.Number[key: r.Concat[".w"], default: Real.RoundI[def.w*100]]]/100; c.r _ Real.Float[UserProfile.Number[key: r.Concat[".r"], default: Real.RoundI[def.r*100]]]/100; c.g _ Real.Float[UserProfile.Number[key: r.Concat[".g"], default: Real.RoundI[def.g*100]]]/100; c.b _ Real.Float[UserProfile.Number[key: r.Concat[".b"], default: Real.RoundI[def.b*100]]]/100; END; FOR i: INT IN [0..numberOfColors) DO currentColor[i] _ DefaultColor[cDefaults[i]]; ENDLOOP; whiteOutLine _ UserProfile.Boolean[ key: Rope.Cat["ChipNDale." , technologyName, ".WhiteOutline"], default: TRUE ]; END; ColorCommand: Commander.CommandProc = BEGIN CreateAnInstance[]; END; ColorComm: PROC [comm: CDSequencer.Command] = BEGIN CreateAnInstance[]; END; Init8Patterns[NIL]; ReadProfileColors[]; ComputeColors[]; CDSequencer.ImplementCommand[$SaturationComm, SaturationComm, technology, doQueue]; CDSequencer.ImplementCommand[$ColorTool, ColorComm, technology, dontQueue]; CDMenus.CreateEntry[$DisplayMenu, Rope.Concat[technologyName, " 8 bit tool"], $ColorTool]; [] _ Buttons.Create[ info: [name: Rope.Concat[technologyName, " colors"]], proc: ResetAndCreateButton ]; Commander.Register[ key: Rope.Cat["CD", technologyName, "ColorRec"], proc: ColorCommand, doc: Rope.Concat[technologyName, " 8 bit color tool"] ]; END. 2NMos8BitColors.mesa Copyright c 1984, 1985 by Xerox Corporation. All rights reserved. Last Edited by: Jacobi, October 29, 1984 5:46:54 pm PST Last Edited by: Jacobi, July 31, 1985 6:11:24 pm PDT --**color device************************************** --experimenting showed that the following line was necessary.... FOR list: ImagerDitherContext.MapEntries _ mapEntries, list.rest WHILE list#NIL DO Terminal.SetColor[terminal, list.first.mapIndex, 0, list.first.red, list.first.green, list.first.blue]; ENDLOOP; --**end color device************************************** --w is a wight; The color of an intersection (i.e. green1 over blue) is the --weighted sum of the rgb of each color. --index 0 is supposed to be background --XXXXXXXXXXXXXXXX TECHNOLOGY XXXXXXXXXXXXXXXX --all parameter are discarded -- no change for bur and ovgc for this background -- no change for bur, nwelCont, pwelCont, and ovgc for this background --XXXXX end technology XXXXXXXXXXXXXXXXXXXXX --we do only open the viewer, --because resetting can not reset already painted sliders... --Resets color map; --does not touch patterns --ResetMapButton -- ButtonProcLayerInternal --create an icon of the tool; --does not change any color setup at initialization of the tool -- create sliders for weights -- create command buttons -- create sliders for rgb colors --takes a color setting (weights and rgb values) and sets up the device --c1 not weighted; wc2 weighted --colors in the range of layers --bit loop --check exception loops --assign color --include further colors from exception loop ΚΘ˜šœ™Jšœ Οmœ7™BJ™8J™5—J˜šΟk ˜ Jšœ˜Jšœ˜Jšžœ˜Jšœ ˜ Jšžœ˜Jšœ˜Jšœ ˜ Jšœ˜Jšœ ˜ Jšœ ˜ J˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜J˜J˜Jšœ˜Jšœ ˜ Jšœ ˜ Jšœ ˜ Jšœ ˜ Jšœ˜Jšœ˜Jšœ˜—J˜šΟbœžœž˜Jšžœžœ˜Ά—Jšž˜J™Icodešœ9˜9J™J™6J˜Jšœ0žœ˜4J˜šŸœ$˜2Jšž˜Jšœ˜šžœž˜KšœCžœ˜Išœ ˜ Kšœ@žœ˜Fšžœžœžœ˜Jšœ9˜9—Jšœ@™@JšœA˜AJ˜—Kšžœžœ˜—Jšžœ ˜Jšžœ˜—J˜šΟn œžœ/˜@Jšž˜Jšœ˜šœSžœ˜Zšžœ>žœžœž™RJšœg™gJšžœ™——JšœA˜AJšœ.˜.Jšžœ˜—J˜šŸœ˜Jšž˜JšœžœžœW˜iJš žœžœžœžœžœžœ˜,Jšžœ˜—J™:J˜š œ žœžœ žœžœžœ˜EJšœL™LJšœ(™(—J˜šœžœžœžœ ˜;Jšœ&™&—J˜Jš œ žœžœžœžœžœ˜JJ˜J˜Jšœ.™.J˜Jšœ&˜&Jšœžœ˜,JšœžœΟc,˜EJšœžœ‘%˜DJ˜šœ žœžœ˜2Jšœ!‘ ˜-Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ‘˜(Jšœ˜—J˜Jšœ žœ˜J˜š  œžœ˜Jšž˜Jšœ'‘˜5Jšœžœ˜J˜šœ žœ˜Jšœ5žœ‘˜RJšœ˜—J˜Jšœ žœ˜J˜šœ žœ˜Jšœ#žœ‘˜;Jšœ‘*˜EJšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšžœžœ#˜8Jšžœ#‘˜6Jšœ˜—J˜Jšžœ˜—J˜š  œ˜#Jšœ™Jšž˜Jšœžœ˜Jšœžœ˜Jšœžœ˜Jšœžœ˜Jšœžœ˜Jšœžœ˜J˜š  œžœ žœžœžœ˜CJšžœ˜JšžœžœP˜ZJšžœ˜—J˜š  œžœžœžœ˜6Jšžœ˜Jšœ?˜?Jšžœ˜—J˜š  œžœžœžœžœ˜?Jšž˜Jšžœ˜Jšžœ˜—J˜Jšœ4˜4Jšœ2˜2Jšœ6˜6Jšœ1˜1Jšœ3˜3Jšœ4˜4Jšœ;˜;Jšœ>˜>J˜Jšœ=˜=Jšœ9˜9Jšœ=˜=J˜Jšœžœ žœ+˜RJšœžœžœ)˜TJšœžœžœ)˜TJ˜Jšœ ˜ Jšœ˜Jšœ!˜!Jšœ˜Jšœ ˜ Jšœ˜Jšœ ˜ Jšœ1™1JšœF™FJšžœ˜—J™Jšœ,™,K˜K˜Kšœžœ˜JšœžœžœΟe˜4J˜Jšœ žœ˜Jšœ žœ‘(˜Jšž˜Jšœ žœ˜Jšœžœ˜šœ˜šœ˜Jšœ ˜ Jšœ ˜ Jšœ ˜ Jšœ ˜ Jšœ˜Jšœžœ˜—Jšœ ˜ Jšœ˜Jšœž˜ Jšœ˜—Jšœ*˜*Jšžœ˜—J˜šžœžœ˜Jšœb˜b—šžœžœžœ˜,Jšœ˜Jšœ0˜0Jšž˜J˜—emphasisšœ˜Jšœ˜Jšœžœ˜ Jšœžœžœ˜UJšœ ˜ Jšœ žœ˜Jšœ˜—Jšœ3˜3Jšœ™šžœ žœžœž˜+Jšœžœ˜'šœ/˜/šœ˜Jšœ˜Jšœžœ˜ Jšœ˜Jšœ˜Jšœ˜J˜ Jšœ˜Jšœžœ˜—Jšœ˜Jšœ žœ3˜BJšœ˜—šœ/˜/Jšœ0‘˜CJšœžœ˜ Jšœ˜Jšœ˜Jšœ˜Jšœ ˜ Jšœ˜Jšœž˜ Jšœ˜—šœ,˜,šœ˜Jšœ˜Jšœžœ˜ Jšœ˜Jšœ˜Jšœ ˜ Jšœ‘˜Jšœ ˜ Jšœžœ˜—Jšœ˜Jšœ˜Jšœ ˜ Jšœ žœ2˜AJšœ˜—Jšœ=˜=Jšžœ˜—J™Jšœ™Jšœ%˜%Jšœ(˜(Jšœ+˜+Jšœ&˜&Jšœ˜J™Jšœ ™ šžœ žœžœž˜!šœžœžœž˜ Jšœ ˜ Jšœ ˜ Jšœ ˜ Jšžœžœ˜—šœ˜šœ%˜%Jšœ˜Jšœ ˜ Jšœ0˜0Jšœ ˜ Jšœ ˜ Jšœž˜ —Jšœ˜—šœ+˜+šœ˜Jšœ ˜ Jšœ0˜0Jšœ˜Jšœ˜—Jšœ˜Jšœ˜Jšœ ˜ Jšœ žœ1˜@Jšœ˜—Jšœ<˜<šœ-˜-Jšœ0‘˜CJšœ ˜ Jšœ0˜0Jšœ ˜ Jšœ ˜ Jšœ˜Jšœž˜ Jšœ˜—Jšžœ˜—J˜Jšœ.‘˜HJšœ)‘˜@Jšœ?˜?Jšžœ˜—J˜šŸœ˜)Jšžœ‘˜Jšœžœ˜šžœžœ˜Jš œžœžœžœžœ˜/š žœžœž œžœž˜/Jšœžœ˜$Jšžœ˜—JšœF˜FJšžœ žœžœ˜šžœž˜"šœ#˜#J˜JšœžœH˜TJ˜—Jšžœ žœžœ˜Jšœ2˜2Jšž˜—Jšžœ˜Jšœ˜J˜—Jšžœ˜—J˜J˜Jšœ žœžœ žœ‘7˜[Jšœ žœžœ žœ‘8˜\Jšœ žœžœ žœ‘!˜EJ˜J˜š  œžœ˜JšœG™GJšž˜J˜š  œžœžœ˜>Jšœ™Jšž ˜ Jšœžœ ˜Jšœ6˜6Jšžœ˜—J˜š œžœžœ˜1Jšž˜š  œžœžœžœžœ˜5Jšœžœžœ˜(Jšœ˜—JšœZ˜ZJšœ žœ˜)Jšžœ˜—J˜Jšœ žœžœžœ˜2Jšœ ˜ Jšœžœ˜&Jšœžœ žœ ˜+J˜Jšžœžœžœ˜J˜Jšœ™šžœžœžœ ž˜ Jšœ˜Jšœ ™ šžœžœžœ ž˜!šžœžœ žœ žœ˜5Jšœ)˜)J˜—Jšž˜—Jšœ™š žœžœžœ"žœžœž˜Dšžœžœžœ˜5Jšžœžœ˜,Jšžœ#˜'Jšœ˜—Jšžœ˜—š žœžœžœ"žœžœž˜Dšžœžœ˜Jšžœžœ˜,Jšžœ#˜'Jšœ˜—Jšžœ˜—J™Jšžœ žœ&˜5Jšžœžœ˜!Jšžœ$˜(Jšœ ˜ Jšžœ˜—Jšœ,™,š žœžœžœ"žœžœž˜DJšžœžœ$˜?Jšžœ˜—Jšœ$˜$Jšžœ˜—J˜š œžœžœ˜#Jšž˜š  œžœžœ˜:Jšž˜Jšœžœ9˜EJšœ_˜_Jšœ_˜_Jšœ_˜_Jšœ_˜_Jšžœ˜—šžœžœžœž˜$Jšœ-˜-Jšžœ˜—šœ#˜#Jšœ?˜?Jšœ ž˜ Jšœ˜—Jšžœ˜J˜—šŸ œ˜%Jšž˜Jšœ˜Jšžœ˜J˜—šŸ œžœ˜-Jšž˜Jšœ˜Jšžœ˜J˜—Jšœžœ˜Jšœ˜Jšœ˜JšœS˜SJšœK˜KJšœZ˜Zšœ˜Jšœ6˜6Jšœ˜Jšœ˜—šœ˜Jšœ1˜1Jšœ˜Jšœ5˜5Jšœ˜—Jšžœ˜J˜—…—D a