; The GIMP -- an image manipulation program ; Copyright (C) 1995 Spencer Kimball and Peter Mattis ; ; Written by Adrian Likins ; 2/15/98 ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ; ; ; 5 minute script to implement some handy PS style keybindings ; add a "Swap Colors" and a "Default Colors" to the /Tools ; menu where they can be assigned key bindings. ; ; ; ; Add the following lines to (without the ";") to get PS style keybindings ; ; (menu-path "/Tools/Swap Colors" "X") ; (menu-path "/Tools/Defualt Colors" "D) (define (script-fu-swap-colors image drawable) (let* ((old-bg-color (car (gimp-palette-get-background))) (old-fg-color (car (gimp-palette-get-foreground)))) (gimp-palette-set-foreground old-bg-color) (gimp-palette-set-background old-fg-color))) (script-fu-register "script-fu-swap-colors" "/Tools/Swap Colors" "Swap the foreground and backgorund color" " Adrian Likins " " Adrian Likins" "02/15/1998" "RGB* INDEXED* GRAY*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0) (define (script-fu-default-colors image drawable) (gimp-palette-set-foreground '(0 0 0)) (gimp-palette-set-background '(255 255 255))) (script-fu-register "script-fu-default-colors" "/Tools/Defualt Colors" "Set the foreground and background colors to black and white" " Adrian Likins " " Adrian Likins" "02/15/1998" "RGB* INDEXED* GRAY*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0)