PRO Save_User_CT,ctName
;+
; NAME:
; 	Save_User_CT
; PURPOSE:
;	Store in a file a user modfified color table.
; CATEGORY
;	Input/Output
; CALLING SEQUENCE
;	Save_User_CT [, name ]
; INPUT ARGUMENT:
;	name: the name of the file where the color table will be
;		saved. If not present, it will be
;		asked interactively.
; COMMON BLOCK:
;	"Colors" is used to get the color table values.
; SIDE EFFECT:
;	When the name is not provided, the terminal window
;	is used to get it.
; RESTRICTION:
;	Works only on x-windows terminals.
;-
; MODIFICATION HISTORY:
;	Created: 4/91, A.Csillaghy

COMMON Colors,red,green,blue,currentRed,currentGreen,currentBlue

IF N_Params() EQ 0 THEN BEGIN
  Clear_Screen
  PTo,3,10,'Save the current color table values'
  PTo,5,1,'Please give the name of the table:'
  ctName=''
  Read,ctName
ENDIF

OpenW,unit,ctName+'.ctb', /GET_LUN
WriteU,unit, currentRed,currentGreen,currentBlue
Free_LUn,unit

RETURN
END
