dots

Personal dotfiles
git clone git://git.gormless.xyz/dots.git
Log | Files | Refs

color.html (3793B)


      1 <head>
      2 <title>color(3) - Plan 9 from User Space</title>
      3 <meta content="text/html; charset=utf-8" http-equiv=Content-Type>
      4 </head>
      5 <body bgcolor=#ffffff>
      6 <table border=0 cellpadding=0 cellspacing=0 width=100%>
      7 <tr height=10><td>
      8 <tr><td width=20><td>
      9 <tr><td width=20><td><b>COLOR(3)</b><td align=right><b>COLOR(3)</b>
     10 <tr><td width=20><td colspan=2>
     11     <br>
     12 <p><font size=+1><b>NAME     </b></font><br>
     13 
     14 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
     15 
     16     cmap2rgb, cmap2rgba, rgb2cmap &ndash; colors and color maps<br>
     17     
     18 </table>
     19 <p><font size=+1><b>SYNOPSIS     </b></font><br>
     20 
     21 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
     22 
     23     <tt><font size=+1>#include &lt;u.h&gt;<br>
     24     #include &lt;libc.h&gt;<br>
     25     #include &lt;draw.h&gt; 
     26     <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
     27     </font></tt>
     28     <tt><font size=+1>int &nbsp;&nbsp;&nbsp;rgb2cmap(int red, int green, int blue) 
     29     <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
     30     </font></tt>
     31     <tt><font size=+1>int &nbsp;&nbsp;&nbsp;cmap2rgb(int col) 
     32     <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
     33     </font></tt>
     34     <tt><font size=+1>int &nbsp;&nbsp;&nbsp;cmap2rgba(int col)<br>
     35     </font></tt>
     36 </table>
     37 <p><font size=+1><b>DESCRIPTION     </b></font><br>
     38 
     39 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
     40 
     41     These routines convert between &#8216;true color&#8217; red/green/blue triples
     42     and the Plan 9 color map. See <a href="../man7/color.html"><i>color</i>(7)</a> for a description of RGBV,
     43     the standard color map. 
     44     <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
     45     
     46     <i>Rgb2cmap</i> takes a trio of color values, scaled from 0 (no intensity)
     47     to 255 (full intensity), and returns the index of the color in
     48     RGBV closest to that represented by those values. 
     49     <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
     50     
     51     <i>Cmap2rgb</i> decomposes the color of RGBV index <i>col</i> and returns a
     52     24-bit integer with the low 8 bits representing the blue value,
     53     the next 8 representing green, and the next 8 representing red.
     54     <i>Cmap2rgba</i> decomposes the color of RGBV index <i>col</i> and returns a
     55     32-bit integer with the low 8 bits representing an alpha value,
     56     defined to be 255, and the next
     57     8 representing blue, then green, then red, as for <i>cmap2rgba</i> shifted
     58     up 8 bits. This 32-bit representation is the format used by <a href="../man3/draw.html"><i>draw</i>(3)</a>
     59     and <a href="../man3/memdraw.html"><i>memdraw</i>(3)</a> library routines that take colors as arguments.<br>
     60     
     61 </table>
     62 <p><font size=+1><b>SOURCE     </b></font><br>
     63 
     64 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
     65 
     66     <tt><font size=+1><a href="/var/usrlocal/plan9/src/libdraw">/var/usrlocal/plan9/src/libdraw</a><br>
     67     </font></tt>
     68 </table>
     69 <p><font size=+1><b>SEE ALSO    </b></font><br>
     70 
     71 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
     72 
     73     <a href="../man3/graphics.html"><i>graphics</i>(3)</a>, <a href="../man3/allocimage.html"><i>allocimage</i>(3)</a>, <a href="../man3/draw.html"><i>draw</i>(3)</a>, <a href="../man7/image.html"><i>image</i>(7)</a>, <a href="../man7/color.html"><i>color</i>(7)</a><br>
     74     
     75 </table>
     76 
     77 <td width=20>
     78 <tr height=20><td>
     79 </table>
     80 <!-- TRAILER -->
     81 <table border=0 cellpadding=0 cellspacing=0 width=100%>
     82 <tr height=15><td width=10><td><td width=10>
     83 <tr><td><td>
     84 <center>
     85 <a href="https://9fans.github.io/plan9port/"><img src="../../dist/glendacircle.png" alt="Space Glenda" border=0></a>
     86 </center>
     87 </table>
     88 <!-- TRAILER -->
     89 </body></html>