[Scilab-users] color question

philippe rouxph.22 at gmail.com
Wed Jun 29 11:08:54 CEST 2016


Hi,

Le 29/06/2016 09:40, Offe rPade a écrit :
> I am using "getcolor". But I do not know how to get rgb from the color id.
> 
> Is it possible?

If you're searching for rgb levels of colors you should use uigetcolor()
 instead of getcolor(). You can also have a look to
functions  "name2rgb" and "rgb2name"  which convert color names to rgb
levels , or "color" which convert a colormap number (= color id) to the
corresponding rgb levels.


See the example below coming from my book about scilab  :
https://goo.gl/m6WFa0

Philippe


%<---%<----%<---%<----%<---%<----%<---%<----%<---%<----%<---%<----


-->//red =  rgb color (255,0,0)

-->rgb=name2rgb("red")
 rgb  =

    255.    0.    0.

-->rgb2name(rgb)
 ans  =

!red   !
!      !
!red1  !

-->// red = color numver 5

-->color("red")
 ans  =

    5.

-->color(rgb(1),rgb(2),rgb(3))
 ans  =

    5.
%<---%<----%<---%<----%<---%<----%<---%<----%<---%<----




More information about the users mailing list