The R Project SVN R

Rev

Rev 32205 | Rev 36820 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 32205 Rev 32444
Line 41... Line 41...
41
 *		red   = ((color	     ) & 255)
41
 *		red   = ((color	     ) & 255)
42
 *		green = ((color >>  8) & 255)
42
 *		green = ((color >>  8) & 255)
43
 *		blue  = ((color >> 16) & 255)
43
 *		blue  = ((color >> 16) & 255)
44
 */
44
 */
45
/*
45
/*
46
 *	Changes from 1.4.0: use top 8 bits as an alpha channel.
46
 *	Changes as from 1.4.0: use top 8 bits as an alpha channel.
47
 * 	0 = opaque, 255 = transparent.
47
 * 	0 = opaque, 255 = transparent.
48
 *	At present only 0 and >0 are used, with no semi-transparent.
48
 *	At present only 0 and >0 are used, with no semi-transparent.
49
 */
49
 */
50
/*
50
/*
51
 * Changes from 2.0.0:  use top 8 bits as full alpha channel
51
 * Changes as from 2.0.0:  use top 8 bits as full alpha channel
52
 *      1 = opaque, 0 = transparent
52
 *      1 = opaque, 0 = transparent
53
 *      [to conform with SVG, PDF and others]
53
 *      [to conform with SVG, PDF and others]
54
 *      and everything in between is used
54
 *      and everything in between is used
55
 *      [which means that NA is not stored as an internal colour;
55
 *      [which means that NA is not stored as an internal colour;
56
 *       it is converted to R_RGBA(255, 255, 255, 0)]
56
 *       it is converted to R_RGBA(255, 255, 255, 0)]
57
 */
57
 */
-
 
58
/* #define R_RGB(r,g,b)	((r)|((g)<<8)|((b)<<16)|(255<<24)) overflows */
58
#define R_RGB(r,g,b)	((r)|((g)<<8)|((b)<<16)|(255<<24))
59
#define R_RGB(r,g,b)	((r)|((g)<<8)|((b)<<16)|0xFF000000)
59
#define R_RGBA(r,g,b,a)	((r)|((g)<<8)|((b)<<16)|((a)<<24))
60
#define R_RGBA(r,g,b,a)	((r)|((g)<<8)|((b)<<16)|((a)<<24))
60
#define R_RED(col)	(((col)	   )&255)
61
#define R_RED(col)	(((col)	   )&255)
61
#define R_GREEN(col)	(((col)>> 8)&255)
62
#define R_GREEN(col)	(((col)>> 8)&255)
62
#define R_BLUE(col)	(((col)>>16)&255)
63
#define R_BLUE(col)	(((col)>>16)&255)
63
#define R_ALPHA(col)	(((col)>>24)&255)
64
#define R_ALPHA(col)	(((col)>>24)&255)