This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-05-05 12:46:41

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

a <color touching> block

I suggest that in sensing there would be a

<color touching>
block that would give you a number from 1 to 255 (the range scratch has for all the different colors) based on the color that that specific sprite would be touching. It would be very useful for saving pictures, sensing all the colors scratch has, etc...

Offline

 

#2 2012-05-05 12:55:27

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: a <color touching> block

Firstly it would need to return three numbers from 1 to 255, one for the red value, one for the green value and one for the blue value, and secondly, how would it work? Would it go from the middle pixel? If so, what would happen if the sprite was odd number of pixels tall/wide?


Why

Offline

 

#3 2012-05-05 13:04:59

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: a <color touching> block

It would be the costume center. It wouldn't need 3 numbers and I just realized that it would be from 1-200. It would take the color that it's touching and match it up with the number that scratch uses from 1-200 that's the closes to it. It wouldn't need 3 numbers because you don't need 3 numbers to use the set pen color block. You need 1 number from 1-200.

Offline

 

#4 2012-05-05 13:12:40

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: a <color touching> block

It's impossible to determine every colour using just one number.


Why

Offline

 

#5 2012-05-05 13:47:11

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: a <color touching> block

RedRocker227 wrote:

It's impossible to determine every colour using just one number.

but it's possible to determine every color scratch uses using just one number.

Offline

 

#6 2012-05-05 14:24:20

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: a <color touching> block

TorbyFork234 wrote:

RedRocker227 wrote:

It's impossible to determine every colour using just one number.

but it's possible to determine every color scratch uses using just one number.

Erm, no it's not. Scratch doesn't use some "magical" colours, they're the same colours as everything else.


Why

Offline

 

#7 2012-05-05 14:35:06

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: a <color touching> block

RedRocker227 wrote:

TorbyFork234 wrote:

RedRocker227 wrote:

It's impossible to determine every colour using just one number.

but it's possible to determine every color scratch uses using just one number.

Erm, no it's not. Scratch doesn't use some "magical" colours, they're the same colours as everything else.

Then how come they only need one number for the pen color?

Offline

 

#8 2012-05-05 14:37:49

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: a <color touching> block

TorbyFork234 wrote:

RedRocker227 wrote:

TorbyFork234 wrote:


but it's possible to determine every color scratch uses using just one number.

Erm, no it's not. Scratch doesn't use some "magical" colours, they're the same colours as everything else.

Then how come they only need one number for the pen color?

I've never used that block, but I'd imagine that only sets the actual colour, so you couldn't adjust the shade or anything.


Why

Offline

 

#9 2012-05-05 14:42:33

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: a <color touching> block

RedRocker227 wrote:

TorbyFork234 wrote:

RedRocker227 wrote:


Erm, no it's not. Scratch doesn't use some "magical" colours, they're the same colours as everything else.

Then how come they only need one number for the pen color?

I've never used that block, but I'd imagine that only sets the actual colour, so you couldn't adjust the shade or anything.

yes. so there could also be

<shade touching>

Offline

 

#10 2012-05-05 15:52:51

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: a <color touching> block

TorbyFork234 wrote:

RedRocker227 wrote:

TorbyFork234 wrote:


but it's possible to determine every color scratch uses using just one number.

Erm, no it's not. Scratch doesn't use some "magical" colours, they're the same colours as everything else.

Then how come they only need one number for the pen color?

Because that actually just sets a "hue" value. The actual colour is a hexadecimal value which also depends on the pen shade as well as pen hue. Plus, there's nothing stopping you from typing a decimal number in there too, so the pen hue can be ANYTHING between 1 and 200, not just an integer.


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#11 2012-05-05 16:07:59

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: a <color touching> block

@RedRocker:
It's actually possible to use one colour for all the possible colours. There are only 16777217 colours in scratch, so every unique value can indeed represent a unique colour!

The numbers that scratch uses from 1 to 200 are indeed hue-only. Scratch takes shade (value/brightness) separately into account, and completely forgets about saturation. It would indeed be better if Scratch added full colour data types, like Bingo and Panther have!

Offline

 

#12 2012-05-05 16:09:59

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: a <color touching> block

Ya, well of course you could, but how would you remember any of them?  tongue


Why

Offline

 

#13 2012-05-06 04:42:10

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: a <color touching> block

RedRocker227 wrote:

Ya, well of course you could, but how would you remember any of them?  tongue

Well, hex colours actually are single numbers, but they are human readable because they were designed in such a way that every digit or two corresponds to a colour. It would be a lot more difficult to do so with decimal  tongue

Offline

 

Board footer