Page 1 of 1

Color points

Posted: Fri Jul 29, 2016 11:52 am
by samjith
I need to colour lines that set by points.

sample code

Code: Select all

set the points of graphic "line" to the points of graphic "line" & cr & the mouseLoc
if i say "set the textcolor of the points of graphic "line" to "red".
the colour of all point changed to red.

How to colour some points in line?

I got a stack by
http://forums.livecode.com/viewtopic.ph ... 960#p85363

and referred
https://sites.google.com/a/pgcps.org/li ... g-programs

Re: Color points

Posted: Fri Jul 29, 2016 5:41 pm
by richmond62
I don't believe you.

I ran this:

on mouseUp
set the textColor of the points of grc "path1" to "red"
end mouseUp


and got this:

button "Button": execution error at line 2 (Chunk: error in object expression) near "61,287", char 25

and I'm not in the least bit surprised as the points of a graphic object are not controls that have
properties, least of all the 'textcolor' property.

So, could you explain what you are doing, Please?

Re: Color points

Posted: Fri Jul 29, 2016 11:27 pm
by [-hh]
Richmond is right.
The "points" of a graphic are a list of numbers, they have no color property.

To colorize points/vertices of a graphic you can use (at most) foreColor, backColor, markerColor and markerFillColor *of the graphic*.

All vertices of a graphic become by that the *same* display (produced by the above color settings).

For different colorized points of graphics simply use different graphics.
There are a lot of sample stacks in this forum and in "Sample Stacks" that show how to do this.
[For example 'Mr. Polygony' is combined by several lines of different colors
http://forums.livecode.com/viewtopic.ph ... 16#p114016
or the points in the graphics here
http://forums.livecode.com/viewtopic.ph ... 07#p113907
are the points of two graphics (a red colored and a yellow colored one)].

Re: Color points

Posted: Sat Jul 30, 2016 8:29 am
by richmond62
Nope:
pointless.jpg

Re: Color points

Posted: Sun Jul 31, 2016 3:34 pm
by richmond62
Here's something really incredibly pointless: but, hey, whatever turns you on!
blobber.png
Stack removed as replaced by newer version below.

Re: Color points

Posted: Sun Jul 31, 2016 4:56 pm
by richmond62
I begin to wonder if . . . . well, never mind; there's a good clinic near me.
blobber2.png

Re: Color points

Posted: Sun Jul 31, 2016 5:29 pm
by Klaus
richmond62 wrote:I begin to wonder if . . . . well, never mind; there's a good clinic near me.
:D :D :D

Re: Color points

Posted: Sun Jul 31, 2016 10:12 pm
by richmond62
I must be mad; otherwise that nonsense about colourising points of a graphic would not have got under
my skin so badly.

Although, when one stops and thinks about things the ability to mark the points of a graphic with some sort of coloured objects
is not necessarily a bad thing.
pointsBlobbed.png