Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
qcolor.c
Go to the documentation of this file.00001 #include <X11/X.h>
00002 #include <X11/Intrinsic.h>
00003 #include <stdio.h>
00004
00005 int main( int argc , char * argv[] )
00006 {
00007 int ii ;
00008 XColor ex_col , sc_col ;
00009 Widget shell ;
00010 XtAppContext app ;
00011 Display * display ;
00012 Screen * screen ;
00013 Colormap colormap ;
00014
00015 shell = XtVaAppInitialize(
00016 &app , "AFNI" , NULL , 0 , &argc , argv , NULL , NULL ) ;
00017
00018 display = XtDisplay(shell) ;
00019 screen = XtScreen(shell) ;
00020 colormap = DefaultColormapOfScreen( screen ) ;
00021
00022 ii = XParseColor( display , colormap , argv[1] , &ex_col ) ;
00023 if( ii == 0 ){ fprintf(stderr,"XParseColor failed\n") ; exit(1) ; }
00024
00025 printf("R = %d G = %d B = %d\n",ex_col.red,ex_col.green,ex_col.blue) ;
00026 exit(0) ;
00027 }