All pastes #1196670 Raw Edit

Colours.

public text v1 · immutable
#1196670 ·published 2008-09-07 19:56 UTC
rendered paste body
alias mycol {
  set %mycolor $1
}

alias setcolor {
  if (%color = black) {
    set %color on
    echo setcolor - on.
  }
  elseif (%color = on) {
    set %color fuckyellow 
    echo setcolor - fuckyellow.
  }
  elseif (%color = fuckyellow) {
    unset %color black
    echo unset setcolor.
  }
}

on *:input:*:{
  if (%color = on) {
    set %mycolor 10
    if (/* !iswm $1) && (!$ctrlenter) {
      var %message1  $+ %mycolor $+ $1-
      say %message1
      halt
    }
  }
  elseif (%color = fuckyellow) {
    set %mycolor $calc(%mycolor + 1)
    if (%mycolor = 8) {
      set %mycolor 9
    }
    if (%mycolor > 15) {
      set %mycolor 1
    }
    elseif (/* !iswm $1) && (!$ctrlenter) { 
      var %message1  $+ %mycolor $+ $1-
      say %message1 
      halt
    }
  }
}