Glimmr Canvas Editor

version 1/100805 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Bringing up the color-picker

    Color-picker mode is a truth state variable. Color-picker mode is false.

    The current color-picking mode is text that varies. The current color-picking mode is "".

    To activate color-picker mode:
        now color-picker mode is true;
        change the display status of the color_picker to g-active;
        change the display status of the drawing_occluder to g-active;
        repeat with chip running through color-chips:
            if chip is the mother color-chip:
                next;
            now the display status of chip is g-active;
        
    To deactivate color-picker mode:
        now color-picker mode is false;
        change the display status of the color_picker to g-inactive;
        change the display status of the drawing_occluder to g-inactive;
        repeat with chip running through color-chips:
            if chip is the mother color-chip:
                next;
            now the display status of chip is g-inactive;
        
    A clicking graphlink rule when the current graphlink window is the drawing-window and color-picker mode is false (this is the no replacement drawing window rule):
        if the current graphlink y >= 4 and the current graphlink y <= 20:
            if the current graphlink x >= 310 and the current graphlink x <= 326:
                follow the foreground color rule;
                now glulx replacement command is "";
                rule succeeds;
            if the current graphlink x >= 354 and the current graphlink x <= 370:
                follow the background color rule;
                now glulx replacement command is "";
                rule succeeds.

    This is the foreground color rule:
        activate color-picker mode;
        Change the current color-picking mode to "FOREGROUND COLOR";
        follow the window-drawing rules for the drawing-window;
            
    This is the background color rule:
        activate color-picker mode;
        Change the current color-picking mode to "BACKGROUND COLOR";
        follow the window-drawing rules for the drawing-window;