comparison src/nsterm.m @ 96835:b7b23d50e42d

under NS, recognize HSB,AHSB as synonyms for HSV,AHSV in color specifications
author Adrian Robert <Adrian.B.Robert@gmail.com>
date Sun, 20 Jul 2008 13:38:08 +0000
parents 47bb47a5494d
children 30f1368d9cf6
comparison
equal deleted inserted replaced
96834:d2e4a0ee9816 96835:b7b23d50e42d
1326 /* -------------------------------------------------------------------------- 1326 /* --------------------------------------------------------------------------
1327 /* On *Step, we recognize several color formats, in addition to a catalog 1327 /* On *Step, we recognize several color formats, in addition to a catalog
1328 of colors found in the file Emacs.clr. Color formats include: 1328 of colors found in the file Emacs.clr. Color formats include:
1329 - #rrggbb or RGBrrggbb where rr, gg, bb specify red, green and blue in hex 1329 - #rrggbb or RGBrrggbb where rr, gg, bb specify red, green and blue in hex
1330 - ARGBaarrggbb is similar, with aa being the alpha channel (FF = opaque) 1330 - ARGBaarrggbb is similar, with aa being the alpha channel (FF = opaque)
1331 - HSVhhssvv and AHSVaahhssvv are similar for hue, saturation, value 1331 - HSVhhssvv and AHSVaahhssvv (or HSB/AHSB) are similar for hue, saturation,
1332 value;
1332 - CMYKccmmyykk is similar for cyan, magenta, yellow, black. */ 1333 - CMYKccmmyykk is similar for cyan, magenta, yellow, black. */
1333 { 1334 {
1334 NSColor * new = nil; 1335 NSColor * new = nil;
1335 const char *hex = NULL; 1336 const char *hex = NULL;
1336 enum { rgb, argb, hsv, ahsv, cmyk, gray } color_space; 1337 enum { rgb, argb, hsv, ahsv, cmyk, gray } color_space;
1374 else if (!memcmp (name, "ARGB", 4) || !memcmp (name, "argb", 4)) 1375 else if (!memcmp (name, "ARGB", 4) || !memcmp (name, "argb", 4))
1375 { 1376 {
1376 hex = name + 4; 1377 hex = name + 4;
1377 color_space = argb; 1378 color_space = argb;
1378 } 1379 }
1379 else if (!memcmp (name, "HSV", 3) || !memcmp (name, "hsv", 3)) 1380 else if (!memcmp (name, "HSV", 3) || !memcmp (name, "hsv", 3) ||
1381 !memcmp (name, "HSB", 3) || !memcmp (name, "hsb", 3))
1380 { 1382 {
1381 hex = name + 3; 1383 hex = name + 3;
1382 color_space = hsv; 1384 color_space = hsv;
1383 } 1385 }
1384 else if (!memcmp (name, "AHSV", 4) || !memcmp (name, "ahsv", 4)) 1386 else if (!memcmp (name, "AHSV", 4) || !memcmp (name, "ahsv", 4) ||
1387 !memcmp (name, "AHSB", 4) || !memcmp (name, "ahsb", 4))
1385 { 1388 {
1386 hex = name + 4; 1389 hex = name + 4;
1387 color_space = ahsv; 1390 color_space = ahsv;
1388 } 1391 }
1389 else if (!memcmp (name, "CMYK", 4) || !memcmp (name, "cmyk", 4)) 1392 else if (!memcmp (name, "CMYK", 4) || !memcmp (name, "cmyk", 4))