Setting attributes (like colour) in input box of an object, being defined in the input box

scampsd shared this question 4 years ago
Answered

Good morning,


I'm making a drawing, based on some horizontal lines.

In order to distinguish those lines, I'd like to give them a separate colour.


In order to draw the lines, I use the Segment() function, which is working fine:

  1. Segment[Point[{1,2}];Point[{2,1}]]

(I know this line is not horizontal, it's just an example)

Drawing this line is working fine.


In order to give a colour for this line, I try to use the SetColour() functin, which is not working fine:

  1. SetColour[Segment[Point[{1,2}];Point[{2,1}]], "blue"]


When I use this function for setting an object which already exists, this is working fine:

  1. SetColour[A, "blue"]

(where A is an already existing point)


Am I doing something wrong or can you confirm that the "SetColour()" function does not work when the object has not been created before?

Comments (2)

photo
1

quote: can you confirm that the "SetColour()" function does not work when the object has not been created before?


Yes, It's must be a object with a name.

(not named-objects are in lists or in commands like your example)

photo
1

Thanks for the quick reply.

© 2021 International GeoGebra Institute