[ch_bg_color.sh]

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#!/bin/bash

R=$1
G=$2
B=$3

/usr/bin/osascript <
tell application "iTerm"
  tell current session of current window
    set background color to {$(($R*65535/255)), $(($G*65535/255)), $(($B*65535/255))}
  end tell
end tell
EOF

AppleScriptを使ってるし完全にMac用。