comparison lispref/frames.texi @ 27093:4b1a67a46d8c

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Mon, 03 Jan 2000 00:19:17 +0000
parents 4577ed337157
children f6b52258db6a
comparison
equal deleted inserted replaced
27092:60f5b0f50db9 27093:4b1a67a46d8c
1403 @code{nil}, the selected frame is used. 1403 @code{nil}, the selected frame is used.
1404 1404
1405 Note that this does not tell you whether the display you are using 1405 Note that this does not tell you whether the display you are using
1406 really supports that color. When using X, you can ask for any defined 1406 really supports that color. When using X, you can ask for any defined
1407 color on any kind of display, and you will get some result---typically, 1407 color on any kind of display, and you will get some result---typically,
1408 the best it knows how to do. Here's an approximate way to test whether 1408 the closest it can do. To determine whether a frame can really display
1409 your display supports the color @var{color}: 1409 a certain color, use @code{color-supported-p} (see below).
1410 1410
1411 @example 1411 @findex x-color-defined-p
1412 (defun x-color-supported-p (color &optional frame)
1413 (and (color-defined-p color frame)
1414 (or (x-display-color-p frame)
1415 (member color '("black" "white"))
1416 (and (> (x-display-planes frame) 1)
1417 (equal color "gray")))))
1418 @end example
1419
1420 This function used to be called @code{x-color-defined-p}, 1412 This function used to be called @code{x-color-defined-p},
1421 and that name is still supported as an alias. 1413 and that name is still supported as an alias.
1422 @end defun 1414 @end defun
1423 1415
1424 @defun defined-colors &optional frame 1416 @defun defined-colors &optional frame
1425 @tindex defined-colors 1417 @tindex defined-colors
1426 This function returns a list of the color names that are defined 1418 This function returns a list of the color names that are defined
1427 and supported on frame @var{frame} (default, the selected frame). 1419 and supported on frame @var{frame} (default, the selected frame).
1428 1420
1421 @findex x-defined-colors
1429 This function used to be called @code{x-defined-colors}, 1422 This function used to be called @code{x-defined-colors},
1430 and that name is still supported as an alias. 1423 and that name is still supported as an alias.
1424 @end defun
1425
1426 @defun color-supported-p color &optional frame background-p
1427 @tindex color-supported-p
1428 This returns @code{t} if @var{frame} can really display the color
1429 @var{color} (or at least something close to it). If @var{frame} is
1430 omitted or @code{nil}, the question applies to the selected frame.
1431
1432 Some terminals support a different set of colors for foreground and
1433 background. If @var{background-p} is non-@code{nil}, that means you are
1434 asking whether @var{color} can be used as a background; otherwise you
1435 are asking whether it can be used as a foreground.
1436
1437 The argument @var{color} must be a valid color name.
1438 @end defun
1439
1440 @defun color-gray-p color &optional frame
1441 @tindex color-gray-p
1442 This returns @code{t} if @var{color} is a shade of gray, as defined on
1443 @var{frame}'s display. If @var{frame} is omitted or @code{nil}, the
1444 question applies to the selected frame. The argument @var{color} must
1445 be a valid color name.
1431 @end defun 1446 @end defun
1432 1447
1433 @defun color-values color &optional frame 1448 @defun color-values color &optional frame
1434 @tindex color-values 1449 @tindex color-values
1435 This function returns a value that describes what @var{color} should 1450 This function returns a value that describes what @var{color} should
1456 1471
1457 The color values are returned for @var{frame}'s display. If @var{frame} 1472 The color values are returned for @var{frame}'s display. If @var{frame}
1458 is omitted or @code{nil}, the information is returned for the selected 1473 is omitted or @code{nil}, the information is returned for the selected
1459 frame's display. 1474 frame's display.
1460 1475
1476 @findex x-color-values
1461 This function used to be called @code{x-color-values}, 1477 This function used to be called @code{x-color-values},
1462 and that name is still supported as an alias. 1478 and that name is still supported as an alias.
1479 @end defun
1480
1481 @defun display-color-p &optional display
1482 @tindex display-color-p
1483 @findex x-display-color-p
1484 This function returns @code{t} if the screen is a color screen.
1485 It used to be called @code{x-display-color-p}, and that name
1486 is still supported as an alias.
1463 @end defun 1487 @end defun
1464 1488
1465 @node Text Terminal Colors 1489 @node Text Terminal Colors
1466 @section Text Terminal Colors 1490 @section Text Terminal Colors
1467 @cindex colors on text-only terminals 1491 @cindex colors on text-only terminals
1479 value is a list of three integers, which give the amount of red, the 1503 value is a list of three integers, which give the amount of red, the
1480 amount of green, and the amount of blue. Each integer ranges in 1504 amount of green, and the amount of blue. Each integer ranges in
1481 principle from 0 to 65535, but in practice the largest value used is 1505 principle from 0 to 65535, but in practice the largest value used is
1482 65280. 1506 65280.
1483 1507
1484 @defun tty-define-color name number &optional rgb 1508 These functions accept a frame as an optional argument. We hope in
1485 @tindex tty-define-color 1509 the future to make Emacs support multiple text-only terminals; then
1510 this'argument will specify which terminal to operate on (the default
1511 being the selected frame). At present, though, the @var{frame} argument
1512 has no effect.
1513
1514 @defun tty-color-define name number &optional rgb frame
1515 @tindex tty-color-define
1486 This function associates the color name @var{name} with 1516 This function associates the color name @var{name} with
1487 color number @var{number} on the terminal. 1517 color number @var{number} on the terminal.
1488 1518
1489 The optional argument @var{rgb}, if specified, is an rgb value; it says 1519 The optional argument @var{rgb}, if specified, is an rgb value; it says
1490 what the color actually looks like. If you do not specify @var{rgb}, 1520 what the color actually looks like. If you do not specify @var{rgb},
1491 then this color cannot be used by @code{tty-color-approximate} to 1521 then this color cannot be used by @code{tty-color-approximate} to
1492 approximate other colors, because Emacs does not know what it looks 1522 approximate other colors, because Emacs does not know what it looks
1493 like. 1523 like.
1494 @end defun 1524 @end defun
1495 1525
1496 @defun tty-clear-colors 1526 @defun tty-color-clear &optional frame
1497 @tindex tty-clear-colors 1527 @tindex tty-color-clear
1498 This function clears the table of defined colors for a text-only terminal. 1528 This function clears the table of defined colors for a text-only terminal.
1499 @end defun 1529 @end defun
1500 1530
1501 @defvar tty-color-alist 1531 @defun tty-color-alist &optional frame
1502 @tindex tty-color-alist 1532 @tindex tty-color-alist
1503 This variable holds an alist recording the colors supported by the 1533 This function returns an alist recording the known colors supported by a
1504 terminal. 1534 text-only terminal.
1505 1535
1506 Each element has the form @code{(@var{name} @var{number} . @var{rgb})} 1536 Each element has the form @code{(@var{name} @var{number} . @var{rgb})}
1507 or @code{(@var{name} @var{number})}. Here, @var{name} is the color 1537 or @code{(@var{name} @var{number})}. Here, @var{name} is the color
1508 name, @var{number} is the number used to specify it to the terminal. 1538 name, @var{number} is the number used to specify it to the terminal.
1509 If present, @var{rgb} is an rgb value that says what the color 1539 If present, @var{rgb} is an rgb value that says what the color
1510 actually looks like. 1540 actually looks like.
1511 @end defvar 1541 @end defun
1512 1542
1513 @defun tty-color-approximate rgb 1543 @defun tty-color-approximate rgb &optional frame
1514 @tindex tty-color-approximate 1544 @tindex tty-color-approximate
1515 This function finds the closest available color, among those in 1545 This function finds the closest color, among the known colors supported
1516 @code{tty-color-alist}, to that described by the rgb value @var{rgb}. 1546 for @var{frame}'s terminal, to that described by the rgb value
1517 @end defun 1547 @var{rgb}.
1518 1548 @end defun
1519 @defun tty-color-translate color 1549
1550 @defun tty-color-translate color &optional frame
1520 @tindex tty-color-translate 1551 @tindex tty-color-translate
1521 This function finds the closest available color, among those in 1552 This function finds the closest color to @var{color} among the known
1522 @code{tty-color-alist}, to the name @var{color}. If that name 1553 colors supported for @var{frame}'s terminal. If the name @var{color} is
1523 is not defined, the value is @code{nil}. 1554 not defined, the value is @code{nil}.
1524 1555
1525 @var{color} can be an X-style @code{#@var{xxxyyyzzz}} specification 1556 @var{color} can be an X-style @code{"#@var{xxxyyyzzz}"} specification
1526 instead of an actual name. 1557 instead of an actual name. The format
1558 @code{"RGB:@var{xx}/@var{yy}/@var{zz}"} is also supported.
1527 @end defun 1559 @end defun
1528 1560
1529 @node Resources 1561 @node Resources
1530 @section X Resources 1562 @section X Resources
1531 1563
1619 1651
1620 @defun x-display-grayscale-p &optional display 1652 @defun x-display-grayscale-p &optional display
1621 This function returns @code{t} if the screen can display shades of gray. 1653 This function returns @code{t} if the screen can display shades of gray.
1622 @end defun 1654 @end defun
1623 1655
1624 @defun x-display-color-p &optional display
1625 This function returns @code{t} if the screen is a color screen.
1626 @end defun
1627
1628 @defun x-display-color-cells &optional display 1656 @defun x-display-color-cells &optional display
1629 This function returns the number of color cells the screen supports. 1657 This function returns the number of color cells the screen supports.
1630 @end defun 1658 @end defun
1631 1659
1632 @ignore 1660 @ignore