comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: custom color table
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: custom color table [message #32174] Sat, 21 September 2002 17:05
Miklos Z. Kiss is currently offline  Miklos Z. Kiss
Messages: 7
Registered: April 2001
Junior Member
Ken -
Thank you. Much appreciated.
-Mik


"Kenneth P. Bowman" <kpb@null.com> wrote in message
news:kpb-F2C293.17383820092002@corp.supernews.com...
> In article <amfo1d$rjj$1@uni00nw.unity.ncsu.edu>,
> "Miklos Z. Kiss" <mzkiss@unity.ncsu.edu> wrote:
>
> This scale goes from black to orange:
>
> color = 30.0
> h = REPLICATE(color, 256)
> s = REPLICATE(1.0, 256)
> v = FINDGEN(256)/255.0
> COLOR_CONVERT, h, s, v, r, g, b, /HSV_TO_RGB
> TVLCT, r, g, b
>
> To go from white to orange use:
>
> h = REPLICATE(color, 256)
> s = FINDGEN(256)/255.0
> v = REPLICATE(1.0, 256)
>
> Regards, Ken Bowman
Re: custom color table [message #32175 is a reply to message #32174] Sat, 21 September 2002 17:04 Go to previous message
Miklos Z. Kiss is currently offline  Miklos Z. Kiss
Messages: 7
Registered: April 2001
Junior Member
Thanks again.
-Mik

"David Fanning" <david@dfanning.com> wrote in message
news:MPG.17f529a76cde48449899b8@news.frii.com...
> David Fanning (david@dfanning.com) writes:
>
>> Congrid(bindgen(256), 253), 1
>
> Whoops! All those "253"s should be "254"s, obviously.
> Let's see 253 + 1 + 1 = 255, not 256. :-(
>
> Cheers,
>
> David
>
> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
Re: custom color table [message #32176 is a reply to message #32175] Sat, 21 September 2002 17:04 Go to previous message
Miklos Z. Kiss is currently offline  Miklos Z. Kiss
Messages: 7
Registered: April 2001
Junior Member
Reimar -
Thanks for the suggestion and the widget.
-Mik


"Reimar Bauer" <R.Bauer@fz-juelich.de> wrote in message
news:ami047$f04i$1@zam602.zam.kfa-juelich.de...
> Miklos Z. Kiss wrote:
>> Many thanks. On these types of monochrome scales, color #0 is black (0,
0,
>> 0), and color #255 is cyan (0, 255, 255) or orange (255, 165, 0). Is
there
>> a simple, or at least, a systematic, way to make a color table in which
>> color #0 is black, color #255 is white, and everything in between is the
>> shade of some the color in question? I am thinking of the way IDL's
>> predefined color tables are, such as color tables, 0, 1, 3, and 8. I
guess
>> technically speaking this would be more of a quasi-monochrome color
table.
>> Thanks again.
>>
>> -Mik
>>
>
>
> Dear Miklos
>
>
> I have a widget to write colortable routines
>
>
>
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/down
load/x_def_colortable.tar.gz
> or as idl5.5 binary
>
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/down
load/x_def_colortable.sav
>
> The output of the widget is a routine whith header and an example image
> like:
>
> pro ct_miklos,start_color=start_color,max_colors=max_colors,colo rs=colors
>
> colors=[[7,255,128,128,250],$
> [0,50,128,255,255],$
> [0,50,255,128,255]]
>
def_colorsystem,colors=colors,start_color=start_color,max_co lors=max_colors
> end
>
>
> For further routines and licensing please have a look at
> http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
>
> best regards
>
> Reimar
>
> --
> Reimar Bauer
>
> Institut fuer Stratosphaerische Chemie (ICG-I)
> Forschungszentrum Juelich
> email: R.Bauer@fz-juelich.de
> ------------------------------------------------------------ -------
> a IDL library at ForschungsZentrum Juelich
> http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
> ============================================================ =======
>
Re: custom color table [message #32178 is a reply to message #32176] Sat, 21 September 2002 12:01 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Reimar Bauer (R.Bauer@fz-juelich.de) writes:

> I am often use !D.Table_size-1 because some system with really old 8-bit
> cards don't have 256 colors. So it's more flexible.

I know. But I've moved on to the 21st century. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: custom color table [message #32180 is a reply to message #32178] Sat, 21 September 2002 07:42 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning wrote:
> David Fanning (david@dfanning.com) writes:
>
>
>> Congrid(bindgen(256), 253), 1
>
>
> Whoops! All those "253"s should be "254"s, obviously.
> Let's see 253 + 1 + 1 = 255, not 256. :-(
>
> Cheers,
>
> David
>

Dear David,

I am often use !D.Table_size-1 because some system with really old 8-bit
cards don't have 256 colors. So it's more flexible.

Cheers

Reimar

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
Re: custom color table [message #32181 is a reply to message #32180] Sat, 21 September 2002 07:35 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Miklos Z. Kiss wrote:
> Many thanks. On these types of monochrome scales, color #0 is black (0, 0,
> 0), and color #255 is cyan (0, 255, 255) or orange (255, 165, 0). Is there
> a simple, or at least, a systematic, way to make a color table in which
> color #0 is black, color #255 is white, and everything in between is the
> shade of some the color in question? I am thinking of the way IDL's
> predefined color tables are, such as color tables, 0, 1, 3, and 8. I guess
> technically speaking this would be more of a quasi-monochrome color table.
> Thanks again.
>
> -Mik
>


Dear Miklos


I have a widget to write colortable routines


http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/x_def_colortable.tar.gz
or as idl5.5 binary
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/x_def_colortable.sav

The output of the widget is a routine whith header and an example image
like:

pro ct_miklos,start_color=start_color,max_colors=max_colors,colo rs=colors

colors=[[7,255,128,128,250],$
[0,50,128,255,255],$
[0,50,255,128,255]]
def_colorsystem,colors=colors,start_color=start_color,max_co lors=max_colors
end


For further routines and licensing please have a look at
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html

best regards

Reimar

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
Re: custom color table [message #32184 is a reply to message #32181] Fri, 20 September 2002 15:38 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <amfo1d$rjj$1@uni00nw.unity.ncsu.edu>,
"Miklos Z. Kiss" <mzkiss@unity.ncsu.edu> wrote:

This scale goes from black to orange:

color = 30.0
h = REPLICATE(color, 256)
s = REPLICATE(1.0, 256)
v = FINDGEN(256)/255.0
COLOR_CONVERT, h, s, v, r, g, b, /HSV_TO_RGB
TVLCT, r, g, b

To go from white to orange use:

h = REPLICATE(color, 256)
s = FINDGEN(256)/255.0
v = REPLICATE(1.0, 256)

Regards, Ken Bowman
Re: custom color table [message #32188 is a reply to message #32184] Fri, 20 September 2002 12:49 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning (david@dfanning.com) writes:

> Congrid(bindgen(256), 253), 1

Whoops! All those "253"s should be "254"s, obviously.
Let's see 253 + 1 + 1 = 255, not 256. :-(

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: custom color table [message #32189 is a reply to message #32188] Fri, 20 September 2002 12:43 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Miklos Z. Kiss (mzkiss@unity.ncsu.edu) writes:

> Many thanks. On these types of monochrome scales, color #0 is black (0, 0,
> 0), and color #255 is cyan (0, 255, 255) or orange (255, 165, 0). Is there
> a simple, or at least, a systematic, way to make a color table in which
> color #0 is black, color #255 is white, and everything in between is the
> shade of some the color in question? I am thinking of the way IDL's
> predefined color tables are, such as color tables, 0, 1, 3, and 8. I guess
> technically speaking this would be more of a quasi-monochrome color table.

OK, sigh...

TVLCT, 0, 0, 0, 0 ; Black
TVLCT, 255, 255, 255, 255 ; White
TVLCT, Congrid(bytarr(256), 253), $
Congrid(bindgen(256), 253), $
Congrid(bindgen(256), 253), 1

And

TVLCT, Congrid(bindgen(256), 253), $
Congrid(BytScl(bindgen(256), top=165), 253), $
Congrid(bytarr(256), 253), 1

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: custom color table [message #32191 is a reply to message #32189] Fri, 20 September 2002 12:00 Go to previous message
Miklos Z. Kiss is currently offline  Miklos Z. Kiss
Messages: 7
Registered: April 2001
Junior Member
Many thanks. On these types of monochrome scales, color #0 is black (0, 0,
0), and color #255 is cyan (0, 255, 255) or orange (255, 165, 0). Is there
a simple, or at least, a systematic, way to make a color table in which
color #0 is black, color #255 is white, and everything in between is the
shade of some the color in question? I am thinking of the way IDL's
predefined color tables are, such as color tables, 0, 1, 3, and 8. I guess
technically speaking this would be more of a quasi-monochrome color table.
Thanks again.

-Mik



"David Fanning" <david@dfanning.com> wrote in message
news:MPG.17f517db4ea2d0509899b6@news.frii.com...
> Miklos Z. Kiss (mzkiss@unity.ncsu.edu) writes:
>
>> I am trying to create a custom monochrome color table in IDL. IDL has
four
>> (maybe five) predefined monochrome color tables (gray scale, red
>> temperature, blue-white, and green-white). XPALETTE will allow me to
create
>> a custom color table, and I can load it using TVLCT, but how do I relate
the
>> red, green, and blue channels mathematically to create a, say, orange,
or
>> cyan monochrome color table?
>
> The color cyan is (0, 255, 255), so a monochrome cyan
> color table is this:
>
> TVLCT, bytarr(256), bindgen(256), bindgen(256)
>
> The color orange is (255, 165, 0), so a monochrome orange
> color table is this:
>
> TVLCT, bindgen(256), BytScl(bindgen(256), top=165), bytarr(256)
>
> Cheers,
>
> David
>
> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
Re: custom color table [message #32193 is a reply to message #32191] Fri, 20 September 2002 11:33 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Miklos Z. Kiss (mzkiss@unity.ncsu.edu) writes:

> I am trying to create a custom monochrome color table in IDL. IDL has four
> (maybe five) predefined monochrome color tables (gray scale, red
> temperature, blue-white, and green-white). XPALETTE will allow me to create
> a custom color table, and I can load it using TVLCT, but how do I relate the
> red, green, and blue channels mathematically to create a, say, orange, or
> cyan monochrome color table?

The color cyan is (0, 255, 255), so a monochrome cyan
color table is this:

TVLCT, bytarr(256), bindgen(256), bindgen(256)

The color orange is (255, 165, 0), so a monochrome orange
color table is this:

TVLCT, bindgen(256), BytScl(bindgen(256), top=165), bytarr(256)

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL Student Edition released
Next Topic: cyclic colour tables?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:28:40 PDT 2025

Total time taken to generate the page: 0.00438 seconds