[89] | 1 | |
---|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
| 3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
| 4 | |
---|
| 5 | <!-- Generated by IDLdoc 2.0 --> |
---|
| 6 | |
---|
| 7 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
---|
| 8 | <head> |
---|
[104] | 9 | <title>getcolor.pro (SAXO Documentation)</title> |
---|
[89] | 10 | |
---|
| 11 | |
---|
| 12 | <link rel="stylesheet" type="text/css" media="all" href="./../../main_files.css" /> |
---|
| 13 | <link rel="stylesheet" type="text/css" media="print" href="./../../main_files_print.css" /> |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | <script type="text/javascript"> |
---|
| 17 | function setTitle() { |
---|
[104] | 18 | parent.document.title="getcolor.pro (SAXO Documentation)"; |
---|
[89] | 19 | } |
---|
| 20 | </script> |
---|
| 21 | </head> |
---|
| 22 | |
---|
| 23 | <body onload="setTitle();"> |
---|
| 24 | |
---|
| 25 | <div id="navbar_title"> |
---|
[104] | 26 | <h1>SAXO Documentation</h1> |
---|
[89] | 27 | </div> |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | <div id="main_navbar"> |
---|
| 31 | |
---|
| 32 | <table cellspacing="0"> |
---|
| 33 | <tr> |
---|
| 34 | |
---|
| 35 | <td><a href="./../../overview.html?format=raw" title="Overview of library">Overview</a></td> |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | <td >Directory</td> |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | <td><a href="./../../idldoc-categories.html?format=raw" title="Browse library by category">Categories</a></td> |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | <td><a href="./../../idldoc-index.html?format=raw" title="Index of files, routines, and parameters">Index</a></td> |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | <td><a href="./../../search-page.html?format=raw" title="Search library">Search</a></td> |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | <td id="selected">File</td> |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | <td >Source</td> |
---|
| 58 | |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | <td><a href="./../../idldoc-help.html?format=raw" title="Help on IDLdoc">Help</a></td> |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | <td >Etc</td> |
---|
| 65 | |
---|
| 66 | <td id="flexible">Developer documentation</td> |
---|
| 67 | </tr> |
---|
| 68 | </table> |
---|
| 69 | |
---|
| 70 | </div> |
---|
| 71 | |
---|
| 72 | <div id="secondary_navbar"> |
---|
| 73 | |
---|
[107] | 74 | <a href="colorbar.html"><<prev file</a> | <a href="lct.html">next file >></a> <a href="getcolor.html?format=raw" target="_TOP">view single page</a> | <a href="./../../index.html?format=raw" target="_TOP">view frames</a> summary: fields | <a href="#routine_summary">routine</a> details: <a href="#routine_details">routine</a> |
---|
[89] | 75 | |
---|
| 76 | </div> |
---|
| 77 | |
---|
| 78 | |
---|
| 79 | <div id="container"> |
---|
| 80 | |
---|
| 81 | <h1 class="directory"><a href="directory-overview.html?format=raw">ToBeReviewed/COULEURS/</a></h1> |
---|
| 82 | <h2 class="pro_file">getcolor.pro</h2> |
---|
| 83 | |
---|
| 84 | <div id="file_attr"> |
---|
| 85 | <dl> |
---|
| 86 | </dl> |
---|
| 87 | </div> |
---|
| 88 | |
---|
| 89 | <div id="file_comments"></div> |
---|
| 90 | |
---|
| 91 | |
---|
| 92 | |
---|
| 93 | |
---|
| 94 | |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | <div id="routine_summary"> |
---|
| 99 | <h2>Routine summary</h2> |
---|
| 100 | |
---|
| 101 | <dl> |
---|
| 102 | |
---|
| 103 | <dt><p><a href="#_COLOR24"><span class="result">result = </span>COLOR24(<span class="result">number</span>)</a></p><dt> |
---|
| 104 | <dd> NAME: GETCOLOR PURPOSE: The original purpose of this function was to enable the user to specify one of the 16 colors supported by the McIDAS color map by name.</dd> |
---|
| 105 | |
---|
| 106 | <dt><p><a href="#_GETCOLOR"><span class="result">result = </span>GETCOLOR(<span class="result">thisColor, index</span>, TRUE=<span class="result">TRUE</span>, NAMES=<span class="result">NAMES</span>, LOAD=<span class="result">LOAD</span>, START=<span class="result">START</span>)</a></p><dt> |
---|
| 107 | <dd></dd> |
---|
| 108 | |
---|
| 109 | </dl> |
---|
| 110 | </div> |
---|
| 111 | |
---|
| 112 | |
---|
| 113 | <div id="routine_details"> |
---|
| 114 | |
---|
| 115 | |
---|
| 116 | <div class="routine_details" id="_COLOR24"> |
---|
| 117 | |
---|
| 118 | <h2><a class="top" href="#container">top</a>COLOR24 </h2> |
---|
| 119 | |
---|
| 120 | <p class="header"> |
---|
| 121 | <span class="result">result = </span>COLOR24(<span class="result"><a href="#_COLOR24_param_number">number</a></span>)</p> |
---|
| 122 | |
---|
| 123 | <div class="comments"> |
---|
| 124 | NAME: |
---|
| 125 | GETCOLOR |
---|
| 126 | |
---|
| 127 | PURPOSE: |
---|
| 128 | The original purpose of this function was to enable the |
---|
| 129 | user to specify one of the 16 colors supported by the |
---|
| 130 | McIDAS color map by name. Over time, however, the function |
---|
| 131 | has become a general purpose function for handling and |
---|
| 132 | supporting drawing colors in a device-independent way. |
---|
| 133 | In particular, I have been looking for ways to write color |
---|
| 134 | handling code that will work transparently on both 8-bit and |
---|
| 135 | 24-bit machines. On 24-bit machines, the code should work the |
---|
| 136 | same where color decomposition is turned on or off. |
---|
| 137 | |
---|
| 138 | (The 16 supported colors in GETCOLOR come from the McIDAS color |
---|
| 139 | table offered on the IDL newsgroup by Liam Gumley.) |
---|
| 140 | |
---|
| 141 | CATEGORY: |
---|
| 142 | Graphics, Color Specification. |
---|
| 143 | |
---|
| 144 | CALLING SEQUENCE: |
---|
| 145 | result = GETCOLOR(color) |
---|
| 146 | |
---|
| 147 | OPTIONAL INPUT PARAMETERS: |
---|
| 148 | COLOR: A string with the "name" of the color. Valid names are: |
---|
| 149 | black |
---|
| 150 | magenta |
---|
| 151 | cyan |
---|
| 152 | yellow |
---|
| 153 | green |
---|
| 154 | red |
---|
| 155 | blue |
---|
| 156 | navy |
---|
| 157 | gold |
---|
| 158 | pink |
---|
| 159 | aqua |
---|
| 160 | orchid |
---|
| 161 | gray |
---|
| 162 | sky |
---|
| 163 | beige |
---|
| 164 | white |
---|
| 165 | |
---|
| 166 | The color YELLOW is returned if the color name can't be resolved. |
---|
| 167 | Case is unimportant. |
---|
| 168 | |
---|
| 169 | If the function is called with just this single input parameter, |
---|
| 170 | the return value is either a 1-by-3 array containing the RGB values of |
---|
| 171 | that particular color, or a 24-bit integer that can be "decomposed" into |
---|
| 172 | that particular color, depending upon the state of the TRUE keyword and |
---|
| 173 | upon whether color decomposition is turned on or off. The state of color |
---|
| 174 | decomposition can ONLY be determined if the program is being run in |
---|
| 175 | IDL 5.2 or higher. |
---|
| 176 | |
---|
| 177 | INDEX: The color table index where the specified color should be loaded. |
---|
| 178 | If this parameter is passed, then the return value of the function is the |
---|
| 179 | index number and not the color triple. (If color decomposition is turned |
---|
| 180 | on AND the user specifies an index parameter, the color is loaded in the |
---|
| 181 | color table at the proper index, but a 24-bit value is returned to the |
---|
| 182 | user in IDL 5.2 and higher.) |
---|
| 183 | |
---|
| 184 | If no positional parameter is present, then the return value is either a 16-by-3 |
---|
| 185 | byte array containing the RGB values of all 16 colors or it is a 16-element |
---|
| 186 | long integer array containing color values that can be decomposed into colors. |
---|
| 187 | The 16-by-3 array is appropriate for loading color tables with the TVLCT command: |
---|
| 188 | |
---|
| 189 | Device, Decomposed=0 |
---|
| 190 | colors = GetColor() |
---|
| 191 | TVLCT, colors, 100 |
---|
| 192 | |
---|
| 193 | |
---|
| 194 | INPUT KEYWORD PARAMETERS: |
---|
| 195 | |
---|
| 196 | NAMES: If this keyword is set, the return value of the function is |
---|
| 197 | a 16-element string array containing the names of the colors. |
---|
| 198 | These names would be appropriate, for example, in building |
---|
| 199 | a list widget with the names of the colors. If the NAMES |
---|
| 200 | keyword is set, the COLOR and INDEX parameters are ignored. |
---|
| 201 | |
---|
| 202 | listID = Widget_List(baseID, Value=GetColor(/Names), YSize=16) |
---|
| 203 | |
---|
| 204 | LOAD: If this keyword is set, all 16 colors are automatically loaded |
---|
| 205 | starting at the color index specified by the START keyword. |
---|
| 206 | Note that setting this keyword means that the return value of the |
---|
| 207 | function will be a structure, with each field of the structure |
---|
| 208 | corresponding to a color name. The value of each field will be |
---|
| 209 | an index number (set by the START keyword) corresponding to the |
---|
| 210 | associated color, or a 24-bit long integer value that creates the |
---|
| 211 | color on a true-color device. What you have as the field values is |
---|
| 212 | determined by the TRUE keyword or whether color decomposition is on |
---|
| 213 | or off in the absense of the TRUE keyword. It will either be a 1-by-3 |
---|
| 214 | byte array or a long integer value. |
---|
| 215 | |
---|
| 216 | START: The starting color index number if the LOAD keyword is set. This keyword |
---|
| 217 | value is ignored unless the LOAD keyword is also set. The keyword is also |
---|
| 218 | ignored if the TRUE keyword is set or if color decomposition in on in |
---|
| 219 | IDL 5.2 and higher. The default value for the START keyword is |
---|
| 220 | !D.TABLE_SIZE - 17. |
---|
| 221 | |
---|
| 222 | TRUE: If this keyword is set, the specified color triple is returned |
---|
| 223 | as a 24-bit integer equivalent. The lowest 8 bits correspond to |
---|
| 224 | the red value; the middle 8 bits to the green value; and the |
---|
| 225 | highest 8 bits correspond to the blue value. In IDL 5.2 and higher, |
---|
| 226 | if color decomposition is turned on, it is as though this keyword |
---|
| 227 | were set. |
---|
| 228 | |
---|
| 229 | COMMON BLOCKS: |
---|
| 230 | None. |
---|
| 231 | |
---|
| 232 | SIDE EFFECTS: |
---|
| 233 | None. |
---|
| 234 | |
---|
| 235 | RESTRICTIONS: |
---|
| 236 | The TRUE keyword causes the START keyword to be ignored. |
---|
| 237 | The NAMES keyword causes the COLOR, INDEX, START, and TRUE parameters to be ignored. |
---|
| 238 | The COLOR parameter is ignored if the LOAD keyword is used. |
---|
| 239 | On systems where it is possible to tell the state of color decomposition |
---|
| 240 | (i.e., IDL 5.2 and higher), a 24-bit value (or values) is automatically |
---|
| 241 | returned if color decomposition is ON. |
---|
| 242 | |
---|
| 243 | EXAMPLE: |
---|
| 244 | To load a yellow color in color index 100 and plot in yellow, type: |
---|
| 245 | |
---|
| 246 | yellow = GETCOLOR('yellow', 100) |
---|
| 247 | PLOT, data, COLOR=yellow |
---|
| 248 | |
---|
| 249 | or, |
---|
| 250 | |
---|
| 251 | PLOT, data, COLOR=GETCOLOR('yellow', 100) |
---|
| 252 | |
---|
| 253 | To do the same thing on a 24-bit color system with decomposed color on, type: |
---|
| 254 | |
---|
| 255 | PLOT, data, COLOR=GETCOLOR('yellow', /TRUE) |
---|
| 256 | |
---|
| 257 | or in IDL 5.2 and higher, |
---|
| 258 | |
---|
| 259 | DEVICE, Decomposed=1 |
---|
| 260 | PLOT, data, COLOR=GETCOLOR('yellow') |
---|
| 261 | |
---|
| 262 | To load all 16 colors into the current color table, starting at |
---|
| 263 | color index 200, type: |
---|
| 264 | |
---|
| 265 | TVLCT, GETCOLOR(), 200 |
---|
| 266 | |
---|
| 267 | To add the color names to a list widget: |
---|
| 268 | |
---|
| 269 | listID = Widget_List(baseID, Value=GetColor(/Names), YSize=16) |
---|
| 270 | |
---|
| 271 | To load all 16 colors and have the color indices returned in a structure: |
---|
| 272 | |
---|
| 273 | DEVICE, Decomposed=0 |
---|
| 274 | colors = GetColor(/Load, Start=1) |
---|
| 275 | HELP, colors, /Structure |
---|
| 276 | PLOT, data, COLOR=colors.yellow |
---|
| 277 | |
---|
| 278 | To get the direct color values as 24-bit integers in color structure fields: |
---|
| 279 | |
---|
| 280 | DEVICE, Decomposed=1 |
---|
| 281 | colors = GetColor(/Load) |
---|
| 282 | PLOT, data, COLOR=colors.yellow |
---|
| 283 | |
---|
| 284 | Note that the START keyword value is ignored if on a 24-bit device, |
---|
| 285 | so it is possible to write completely device-independent code by |
---|
| 286 | writing code like this: |
---|
| 287 | |
---|
| 288 | colors = GetColor(/Load) |
---|
| 289 | PLOT, data, Color=colors.yellow |
---|
| 290 | |
---|
| 291 | MODIFICATION HISTORY: |
---|
| 292 | Written by: David Fanning, 10 February 96. |
---|
| 293 | Fixed a bug in which N_ELEMENTS was spelled wrong. 7 Dec 96. DWF |
---|
| 294 | Added the McIDAS colors to the program. 24 Feb 99. DWF |
---|
| 295 | Added the INDEX parameter to the program 8 Mar 99. DWF |
---|
| 296 | Added the NAMES keyword at insistence of Martin Schultz. 10 Mar 99. DWF |
---|
| 297 | Reorderd the colors so black is first and white is last. 7 June 99. DWF |
---|
| 298 | Added automatic recognition of DECOMPOSED=1 state. 7 June 99. DWF |
---|
| 299 | Added LOAD AND START keywords. 7 June 99. DWF.</div> |
---|
| 300 | |
---|
| 301 | |
---|
| 302 | |
---|
| 303 | |
---|
| 304 | <h3>Parameters</h3> |
---|
| 305 | |
---|
| 306 | |
---|
| 307 | <h4 id="_COLOR24_param_number">number |
---|
| 308 | |
---|
| 309 | |
---|
| 310 | |
---|
| 311 | |
---|
| 312 | |
---|
| 313 | |
---|
| 314 | |
---|
| 315 | |
---|
| 316 | </h4> |
---|
| 317 | |
---|
| 318 | <div class="comments"></div> |
---|
| 319 | |
---|
| 320 | |
---|
| 321 | |
---|
| 322 | |
---|
| 323 | |
---|
| 324 | |
---|
| 325 | |
---|
| 326 | |
---|
| 327 | |
---|
| 328 | |
---|
| 329 | |
---|
| 330 | |
---|
| 331 | |
---|
| 332 | |
---|
| 333 | |
---|
| 334 | |
---|
| 335 | |
---|
| 336 | |
---|
| 337 | |
---|
| 338 | |
---|
| 339 | |
---|
| 340 | |
---|
| 341 | |
---|
| 342 | |
---|
| 343 | |
---|
| 344 | |
---|
| 345 | |
---|
| 346 | |
---|
| 347 | |
---|
| 348 | </div> |
---|
| 349 | |
---|
| 350 | |
---|
| 351 | <div class="routine_details" id="_GETCOLOR"> |
---|
| 352 | |
---|
| 353 | <h2><a class="top" href="#container">top</a>GETCOLOR </h2> |
---|
| 354 | |
---|
| 355 | <p class="header"> |
---|
| 356 | <span class="result">result = </span>GETCOLOR(<span class="result"><a href="#_GETCOLOR_param_thisColor">thisColor</a>, <a href="#_GETCOLOR_param_index">index</a></span>, <a href="#_GETCOLOR_keyword_TRUE">TRUE</a>=<span class="result">TRUE</span>, <a href="#_GETCOLOR_keyword_NAMES">NAMES</a>=<span class="result">NAMES</span>, <a href="#_GETCOLOR_keyword_LOAD">LOAD</a>=<span class="result">LOAD</span>, <a href="#_GETCOLOR_keyword_START">START</a>=<span class="result">START</span>)</p> |
---|
| 357 | |
---|
| 358 | <div class="comments"></div> |
---|
| 359 | |
---|
| 360 | |
---|
| 361 | |
---|
| 362 | |
---|
| 363 | <h3>Parameters</h3> |
---|
| 364 | |
---|
| 365 | |
---|
| 366 | <h4 id="_GETCOLOR_param_thisColor">thisColor |
---|
| 367 | |
---|
| 368 | |
---|
| 369 | |
---|
| 370 | |
---|
| 371 | |
---|
| 372 | |
---|
| 373 | |
---|
| 374 | |
---|
| 375 | </h4> |
---|
| 376 | |
---|
| 377 | <div class="comments"></div> |
---|
| 378 | |
---|
| 379 | <h4 id="_GETCOLOR_param_index">index |
---|
| 380 | |
---|
| 381 | |
---|
| 382 | |
---|
| 383 | |
---|
| 384 | |
---|
| 385 | |
---|
| 386 | |
---|
| 387 | |
---|
| 388 | </h4> |
---|
| 389 | |
---|
| 390 | <div class="comments"></div> |
---|
| 391 | |
---|
| 392 | |
---|
| 393 | |
---|
| 394 | |
---|
| 395 | |
---|
| 396 | |
---|
| 397 | <h3>Keywords</h3> |
---|
| 398 | |
---|
| 399 | <h4 id="_GETCOLOR_keyword_TRUE">TRUE |
---|
| 400 | |
---|
| 401 | |
---|
| 402 | |
---|
| 403 | |
---|
| 404 | |
---|
| 405 | |
---|
| 406 | |
---|
| 407 | |
---|
| 408 | </h4> |
---|
| 409 | |
---|
| 410 | <div class="comments"></div> |
---|
| 411 | |
---|
| 412 | <h4 id="_GETCOLOR_keyword_NAMES">NAMES |
---|
| 413 | |
---|
| 414 | |
---|
| 415 | |
---|
| 416 | |
---|
| 417 | |
---|
| 418 | |
---|
| 419 | |
---|
| 420 | |
---|
| 421 | </h4> |
---|
| 422 | |
---|
| 423 | <div class="comments"></div> |
---|
| 424 | |
---|
| 425 | <h4 id="_GETCOLOR_keyword_LOAD">LOAD |
---|
| 426 | |
---|
| 427 | |
---|
| 428 | |
---|
| 429 | |
---|
| 430 | |
---|
| 431 | |
---|
| 432 | |
---|
| 433 | |
---|
| 434 | </h4> |
---|
| 435 | |
---|
| 436 | <div class="comments"></div> |
---|
| 437 | |
---|
| 438 | <h4 id="_GETCOLOR_keyword_START">START |
---|
| 439 | |
---|
| 440 | |
---|
| 441 | |
---|
| 442 | |
---|
| 443 | |
---|
| 444 | |
---|
| 445 | |
---|
| 446 | |
---|
| 447 | </h4> |
---|
| 448 | |
---|
| 449 | <div class="comments"></div> |
---|
| 450 | |
---|
| 451 | |
---|
| 452 | |
---|
| 453 | |
---|
| 454 | |
---|
| 455 | |
---|
| 456 | |
---|
| 457 | |
---|
| 458 | |
---|
| 459 | |
---|
| 460 | |
---|
| 461 | |
---|
| 462 | |
---|
| 463 | |
---|
| 464 | |
---|
| 465 | |
---|
| 466 | |
---|
| 467 | |
---|
| 468 | |
---|
| 469 | |
---|
| 470 | |
---|
| 471 | |
---|
| 472 | |
---|
| 473 | |
---|
| 474 | |
---|
| 475 | |
---|
| 476 | </div> |
---|
| 477 | |
---|
| 478 | </div> |
---|
| 479 | |
---|
| 480 | |
---|
| 481 | |
---|
| 482 | <div id="tagline">Produced by IDLdoc 2.0.</div> |
---|
| 483 | |
---|
| 484 | </div> |
---|
| 485 | |
---|
| 486 | </body> |
---|
| 487 | </html> |
---|