Strange colors

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Strange colors

Post by dunbarx » Wed Apr 10, 2024 3:55 pm

All.

This post is based on an earlier thread here (of low life expectancy) about the idea that the backColor of a control can be an integer. This is, er, not well documented.

This automated sample stack sets the backColor of a control to all the integers up to 260. I went above 255 just to see what would happen. Integers above 255 are black.

It is a show. The progression seems to visually repeat, but although the control seems to show the same sequence of colors, they successively darken. Also, the timing of each "progression" is the same for six "passes", but then, around the 210 mark, changes.

It is interesting to see, if one examines the sorted output field line by line, how the number "51" seems to be of interest. Note that 255 mod 51 = 0. Hmmm.

I always use "42".

One handler in the button "Begin".

Craig
strangeColors.livecode.zip
(2.38 KiB) Downloaded 13 times
Last edited by dunbarx on Wed Apr 10, 2024 6:06 pm, edited 3 times in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9393
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Strange colors

Post by richmond62 » Wed Apr 10, 2024 4:54 pm

Why should your previous thread have a low life expectancy (unless you were expecting me to respond and you consider me a low life ROFL). Surely it would have been sensible to put your message here, err, there?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Strange colors

Post by dunbarx » Wed Apr 10, 2024 6:02 pm

Richmond.

You are no lower a life form than me. I am smug about that.

Heather said so, in that thread. Scotland (rightly) does not want the two forums to mix their posts, or even reference them between each other.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9393
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Strange colors

Post by richmond62 » Wed Apr 10, 2024 6:36 pm

No: you are confusing the threads. The 'funny colors' thread is not the one you refer to.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Strange colors

Post by dunbarx » Wed Apr 10, 2024 7:15 pm

Ah.That was over there, eh?

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9393
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Strange colors

Post by richmond62 » Thu Apr 11, 2024 10:16 am

Here's something far, far less fancy, and far, easier for bottom feeders like me to understand:
-
bFeeder.jpg
bFeeder.jpg (9.87 KiB) Viewed 398 times
https://www.swaddorset.org/bottom-feede ... -position/
-
SShot 2024-04-11 at 12.09.15.png
-
Each square is set to a single integer colour . . .
Attachments
Kullerz.livecode.zip
Stack.
(6.96 KiB) Downloaded 13 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9393
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Strange colors

Post by richmond62 » Thu Apr 11, 2024 11:53 am

Not sure if these are of any interest or use at all:

https://gist.github.com/callumlocke/41b ... 90f07c2d96

" convert three r,g,b integers (each 0-255) to a single decimal integer (something between 0 and ~16m)"

https://www.syncfusion.com/faq/windowsf ... vice-versa

ANYWAY . . . what IS obvious is that colours are defined by single integers in some places. Although, admittedly, that comment is fairly crass and on little value. 8)

------
Irrelevant wibble following:
------

"If a tree falls in the 16-6340 TPX Classic Green forest, and nobody's there to hear it, can Pantone really sue the forest? "

https://www.reddit.com/r/GIMP/comments/ ... ?rdt=35631

That comment really tickled me pink. 8)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Strange colors

Post by dunbarx » Thu Apr 11, 2024 2:28 pm

Richmond.

Glad to see that we are both willing to work hard at anything but our work.

You can see the pseudo-repetition every 36 "passes", though getting darker as you go. And the whole thing changes after six such, with a gray-scale sequence at the very end.

All this was just to explore the fact that integers can be valid (or at least non-error) color references, and is not documented. But is there anything of interest or value here at all?

Craig

Post Reply

Return to “Talking LiveCode”