<> <> <> <> <<>> DIRECTORY CD USING [Layer, ContextFilter], Imager USING [Color]; <<-- ChipNDale interface defining low level color handling. >> <<-- (semi-public) >> CDColors: CEDAR DEFINITIONS = BEGIN DisplayType: TYPE = {bw, bit1, bit2, bit4, bit8, bit9}; --displays supported by ChipNDale (bits per pixel) DisplayMode: TYPE = {normal, pushedOut}; --usage of brick Brick: TYPE = ARRAY [0..4) OF CARDINAL; --brick, or'ed into a bitmap ColorTable: TYPE = RECORD [ bricks: REF ARRAY CD.Layer OF REF Brick, filter: REF CD.ContextFilter, cols: REF ARRAY CD.Layer OF Imager.Color ]; ColorTableSet: TYPE = ARRAY DisplayMode OF REF ColorTable; ColorDefinition: TYPE = ARRAY DisplayType OF REF ColorTableSet; globalColors: READONLY REF ColorDefinition; <<--everything is readonly >> <<--but this module causes changes to the REF Brick (not the Brick)>> DefineColor: PROC[ layer: CD.Layer, brick: REF Brick _ NIL, -- do no more change the values display: DisplayType _ bw, mode: DisplayMode _ normal, table: REF ColorDefinition _ NIL --NIL uses the global table ]; <<--Defining a brick with mode normal also clears the pushedOut brick.>> <<--A NIL brick makes a reasonable default.>> <<--The procedure may exchange bricks if they have the same values.>> DefineIColor: PROC [ layer: CD.Layer, col: Imager.Color _ NIL, display: DisplayType _ bw, mode: DisplayMode _ normal, table: REF ColorDefinition _ NIL --NIL uses the global table ]; <<--Defining color filters for either display.>> <<--A NIL color makes a layer invisible.>> END.