[Scilab-users] color question

Offe rPade oferpade at 013net.net
Wed Jun 29 11:41:20 CEST 2016


Hi  Philippe
Thanks!
Offer

-----Original Message-----
From: users [mailto:users-bounces at lists.scilab.org] On Behalf Of philippe
Sent: Wednesday, June 29, 2016 12:09 PM
To: users at lists.scilab.org
Subject: Re: [Scilab-users] color question

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.
%<---%<----%<---%<----%<---%<----%<---%<----%<---%<----

_______________________________________________
users mailing list
users at lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




More information about the users mailing list