How to set line opacity using command?

Math123 shared this question 11 months ago
Answered

Line Opacity command

Comments (29)

photo
1

How to adjust line opacity using command. Your prompt response is needed . Thanks. I want to write this command in script.

photo
1

Try the script command: SetDynamicColor( <Object>, <Red>, <Green>, <Blue>, <Opacity> )

or use SetColor() in the hexadecimal format: SetColor(text1, "#80FF0000") (example for 50% red)

photo
1

Not working. I make a line and this command not working with opacity. But it is working without opacity (Only color changing).

I need line opacity change.

photo
1

Line has not opacity property

no possible to change a no property of some object

In HSL and HSV system of colour you can modify saturation and lightness

photo
1

line opacity: see properties/style/opacity (slider)

exist in 5.0 and 6.0 and in xml

photo
1

the style opacity can not select with set command and the alpha property is not read by GG

I think the older opacity must be deprecated and to use only alpha for all objects

I hope devs think it too

/+r3XQdWY9f4AAAAAElFTkSuQmCC

photo
photo
1

Thanks for the reply rami. But i need just opacity change without change in color . and there are so many line in my project with different colors. i can not manage opacity in that format.

photo
1

sorry not possible with scripts. (see bug report)

It also does not work as described in the manual.

a complex and elaborate workaround with JS-XML-commands is (maybe!!) possible.

photo
1

is it possible to use color code to change text color in dynamic text box.

\setcolor{Computer Science,255,102,45} Not working Pls correct

\setcolor{Computer Science,"#FF6600"} Not working with inside text

photo
1

as ggb-command

SetColor(<object (also named text-object)>,255/255, 102/255, 45/255) the value must be 0 to 1

(what is "inside-text"? if you mean inside a list: not possible because each list has all properties only 1 time (not for specific list elements), if you mean inside text-box: yes with laTeX (maybe!! latex is also possible in text-elements inside a list, but with laTeX = ON))

samples with laTeX: see here

in the hexadecimal format see the sample in the bug message. (very tricky!! not use)

photo
1

Setcolor command not working in text box

\SetColor{Computer Science,255/255,102/255,45/255}

photo
1

If "Computer Science" is the text him self: this is not possible. SetColor() need a named object (for example text12) see also my last post (read again)

falls das der Fehler ist: verwende laTeX

Note: I go offline some hours.

photo
1

Hello Hayat,

To change dynamically the color inside a text, you have to define a "user defined color" with a LaTex command (see the link in rami's last post) :

\definecolor{mycolor}{rgb}{number between 0 and 1,number between 0 and 1,number between 0 and 1}

You have an example here : https://www.geogebra.org/m/ncg8fvmb

(Move the sliders R, G and B to see color changing)

Regards,

Pierre

photo
1

thanks Pierre Rubod for the reply, but where i define color in dynamic text box or in command

\definecolor{name of color i want set}{rgb}{r,g,b} where i define this

photo
1

Also this is very problematic to remember the name of color . is there any direct command in which i put the number of color.

Also there is no name of colors which is in the setting -> Color

photo
1

I'm not sure to understand what you want ... So,

- First idea : to define color in dynamic text box, you have to insert in the text :

\textcolor{name of color you want}{text you want to colour}

(see the texte1 field in my file)

- Second idea : the predefined colors for LaTex are here : https://wiki.geogebra.org/e...

Regards,

Pierre

PS : il will be offline from now

photo
photo
1

Send a small example as GGB-File include the vaiables to change the color (for example a slider or one ore more bolean)

photo
1

Pls see attachment . In the text box i want to change the color of text "Computer Science" itself by using color number of rgb.

\setcolor{Computer Science}{255/255,102/255,45/225}

This is not working any other solution? Computer Science is the text itself not object. There are so many text in the text box in my project and i want direct color change using color no.

photo
1

I want color change as command in text box by their color number (r,g,b) with direct text.

fe4233ae4160d059d3c05fc585dac16d

photo
2

The "SetColor" will have no effect in a text field.


You have to use LaTex commands : \definecolor then \textcolor

It seems like you cannot enter fractions in "definecolor". See the attached file in which I have used variables, and it works (you can also enter directly decimal values)

The pre-defined colors you can use with LaTex are here : https://en.wikibooks.org/wi...

photo
1

So, how can i enter the exact no of color (which is between 0-255) which i see properties -> color

photo
1

Pls inform how to use these color the link you shared.

photo
2

Choose the color you want, then you have the RGB values, then divide these values by 255.

/A08TjaUzOqN6AAAAAElFTkSuQmCC

photo
1

Thanks @Pierre . The procedure is pretty long and also every time i want to give name the color . Specially when i want ti change color several times.

But i will work. Thank you so much for the support.

photo
2

To use pre-defined colors, simply enter the name of the color : \textcolor{BlueViolet}{your text}

See attached file

photo
1

How do i know the color no which i used as predefined color in text. because i want to set my relevant object with the same color.

photo
1

If you have used a color (with RGB values and a name choosed by you, or with the name of a pre-defined color),

you know what color you have used, no ?

So I really don't understand your problem ... just use the same color for your relevant object by using SetColor command.

If you still need an answer please post a precise and very clear description of what you want to do.

Regards,

Pierre

photo
1

Thanks i got answer as you mentioned. I used command for command setcolor(object,color name) of my object.

photo
1

I used \textcolor{fuchsia}{Computer} in text it changed color correctly.

When i used command setcolor(i,fuchsia) where "i" is ray. It change color to magenta.

photo
© 2020 International GeoGebra Institute