Discuss Scratch

red_king_cyclops
Scratcher
500+ posts

Color Variables

So in Scratch there are a few blocks that use color boxes, that directly use a color instead of a number. So, what if there were variables that saved the color of something?

Here's an example of a block that could be based off color variables:
set [ vColor Variable #1] to [#534c0d]

Here is an example of how a color variable could be used:
<touching color (Color Variable #1) ?>

2+2=4
2*2=4
2^2=4
2^^2=4
2^^^2=4
2^^^^2=4

I see a pattern.
jromagnoli
Scratcher
1000+ posts

Color Variables

red_king_cyclops wrote:

So in Scratch there are a few blocks that use color boxes, that directly use a color instead of a number. So, what if there were variables that saved the color of something?

Here's an example of a block that could be based off color variables:
set [ vColor Variable #1] to [#534c0d]

Here is an example of how a color variable could be used:
<touching color (Color Variable #1) ?>
You can put hex codes in cloud variables.:
set [☁ score v] to (join [0x] (hex value))
<touching color (☁ score) ?>

Last edited by jromagnoli (April 11, 2017 00:36:18)





ROAD TO 10,000 POSTS
████████████████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 64%










If you can read this, my signature cubeupload has been eaten by an evil kumquat!
hehehe!Mytiptopsecrettopicidentifier!ahjdgggfhjadggahjsahasgdjfsdjfga

TheLogFather
Scratcher
1000+ posts

Color Variables

jromagnoli wrote:

You can put hex codes in cloud variables.:
set [☁ score v] to (join [0x] (hex value))
<touching color (☁ score) ?>
Why “cloud variables” in particular? I'm not aware of any reason it has to be a cloud variable. (Indeed, it'd really be way better to *not* use a cloudvar…)

Any variable (local, global, cloud) can contain a numerical value in hex, if it has the “0x” (or “0X”) prefix.


Siggy the Kumquat slayer:
Main account: DadOfMrLog –– Frameworks for basic pen-rendered 3D in scratch (see studio). Examples:

- - - - 3D Text - - - - - - Simple shapes - - - Controllable structures - - - On the ground - - - - - - In space - - - -

NitroCipher
Scratcher
500+ posts

Color Variables

Here: https://scratch.mit.edu/projects/155246726/

This is a custom block that I made for just this purpose.

set [variable v] to [#66dd44] ::custom

define set [var] to [color]
set (var) to (color)

If you do intend on using it, please drop some credit in the description.

I hope my post helped you in some way! Post count: 500+

Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!
This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
jromagnoli
Scratcher
1000+ posts

Color Variables

TheLogFather wrote:

jromagnoli wrote:

You can put hex codes in cloud variables.:
set [☁ score v] to (join [0x] (hex value))
<touching color (☁ score) ?>
Why “cloud variables” in particular? I'm not aware of any reason it has to be a cloud variable. (Indeed, it'd really be way better to *not* use a cloudvar…)

Any variable (local, global, cloud) can contain a numerical value in hex, if it has the “0x” (or “0X”) prefix.

Sorry, I read it wrong and thought they wanted a cloud variable.




ROAD TO 10,000 POSTS
████████████████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 64%










If you can read this, my signature cubeupload has been eaten by an evil kumquat!
hehehe!Mytiptopsecrettopicidentifier!ahjdgggfhjadggahjsahasgdjfsdjfga

red_king_cyclops
Scratcher
500+ posts

Color Variables

jromagnoli wrote:

red_king_cyclops wrote:

So in Scratch there are a few blocks that use color boxes, that directly use a color instead of a number. So, what if there were variables that saved the color of something?

Here's an example of a block that could be based off color variables:
set [ vColor Variable #1] to [#534c0d]

Here is an example of how a color variable could be used:
<touching color (Color Variable #1) ?>
You can put hex codes in cloud variables.:
set [☁ score v] to (join [0x] (hex value))
<touching color (☁ score) ?>

Thank you for telling me about hex codes, and how I could use them as a work-around to my suggestion.

NitroCipher wrote:

Here: https://scratch.mit.edu/projects/155246726/

This is a custom block that I made for just this purpose.

set [variable v] to [#66dd44] ::custom

define set [var] to [color]
set (var) to (color)

If you do intend on using it, please drop some credit in the description.

Thank you for making me this custom block. It could be useful.

TheLogFather wrote:

jromagnoli wrote:

You can put hex codes in cloud variables.:
set [☁ score v] to (join [0x] (hex value))
<touching color (☁ score) ?>
Why “cloud variables” in particular? I'm not aware of any reason it has to be a cloud variable. (Indeed, it'd really be way better to *not* use a cloudvar…)

Any variable (local, global, cloud) can contain a numerical value in hex, if it has the “0x” (or “0X”) prefix.


Thank you for correcting @jromagnoli

2+2=4
2*2=4
2^2=4
2^^2=4
2^^^2=4
2^^^^2=4

I see a pattern.
Pezd
Scratcher
100+ posts

Color Variables

Probably a block like this would be better.
It would report the color selected as a number.

(color [#FF0000]:: sensing

Last edited by Pezd (April 14, 2017 16:10:07)


Check out my four newest projects!

red_king_cyclops
Scratcher
500+ posts

Color Variables

Pezd wrote:

Probably a block like this would be better.
It would report the color selected as a number.

(color [#FF0000]:: sensing)

This is a great suggestion, even better than mine. Thank you for stating it.

Last edited by red_king_cyclops (April 15, 2017 23:32:15)


2+2=4
2*2=4
2^2=4
2^^2=4
2^^^2=4
2^^^^2=4

I see a pattern.
TheLogFather
Scratcher
1000+ posts

Color Variables

Pezd wrote:

Probably a block like this would be better.
It would report the color selected as a number.

(color [#FF0000]:: sensing
I really like this concept – I would certainly see it as having several uses!


I can foresee some potential confusion, though – in particular, Scratchers trying to drop it into places where it appears to make sense at first, but really doesn't when you know what the block actually is (i.e. a numerical value):

<touching (color [#ff0000] :: sensing)?> // oops! 
set [color v] effect to (color [#ff0000] :: sensing) // would be kinda nice... :)
(distance to (color [#ff0000] :: sensing)) // heh ;)
point towards (color [#ff0000] :: sensing) // *grin*
go to (color [#ff0000] :: sensing) // *grin* ^2
(letter (3) of (color [#ff0000] :: sensing)) // OK, bit wacky this one – but is this "d", since the colour is "red"...? :D

Not sure how to avoid misconceptions like that…?

Last edited by TheLogFather (April 17, 2017 14:16:36)


Siggy the Kumquat slayer:
Main account: DadOfMrLog –– Frameworks for basic pen-rendered 3D in scratch (see studio). Examples:

- - - - 3D Text - - - - - - Simple shapes - - - Controllable structures - - - On the ground - - - - - - In space - - - -

Pezd
Scratcher
100+ posts

Color Variables


TheLogFather wrote:

Pezd wrote:

Probably a block like this would be better.
It would report the color selected as a number.

(color [#FF0000]:: sensing
I really like this concept – I would certainly see it as having several uses!


I can foresee some potential confusion, though – in particular, Scratchers trying to drop it into places where it appears to make sense at first, but really doesn't when you know what the block actually is (i.e. a numerical value):

<touching (color [#ff0000] :: sensing)?> // oops! 
set [color v] effect to (color [#ff0000] :: sensing) // would be kinda nice... :)
(distance to (color [#ff0000] :: sensing)) // heh ;)
(point towards (color [#ff0000] :: sensing)) // *grin*
(go to (color [#ff0000] :: sensing)) // *grin* ^2
(letter (3) of (color [#ff0000] :: sensing)) // OK, bit wacky this one – but is this "d", since the colour is "red"...? :D

Not sure how to avoid misconceptions like that…?


lololololol
Well you can make those same mistakes with scratch blocks already present.

set [color v] effect to <touching color [#b72590] ?>// this statement makes sense if you don't know the difference between reporters and baleans.

go to x: (distance to [sprite v]) y: (distance to [sprite v])

Wait a second. I never knew there was any of these blocks

(go to ())
(point towards ())

Last edited by Pezd (April 17, 2017 14:18:51)


Check out my four newest projects!

TheLogFather
Scratcher
1000+ posts

Color Variables

Pezd wrote:

Wait a second. I never knew there was any of these blocks
(go to ())
(point towards ())
Oops! –Left the brackets in there. [Fixed!]

Meant:
go to (color [#ff0000] :: sensing)
point towards (color [#ff0000] :: sensing)

I.e. these blocks:
go to [something v]
point towards [something v]

Also, thinking a bit more about it, I don't see why it would be a blue sensor block – it has nothing to do with sensing (and that's potentially part of the problem with misconceptions).

Not sure what it would be in, though… A green Operator block? An orange Data block?

(color [#ff0000] :: operators)
(color [#ff0000] :: variables)

Last edited by TheLogFather (April 17, 2017 14:21:33)


Siggy the Kumquat slayer:
Main account: DadOfMrLog –– Frameworks for basic pen-rendered 3D in scratch (see studio). Examples:

- - - - 3D Text - - - - - - Simple shapes - - - Controllable structures - - - On the ground - - - - - - In space - - - -

Pezd
Scratcher
100+ posts

Color Variables

TheLogFather wrote:

Pezd wrote:

Wait a second. I never knew there was any of these blocks
(go to ())
(point towards ())
Oops! –Left the brackets in there.

Meant:
go to (color [#ff0000] :: sensing)
point towards (color [#ff0000] :: sensing)

I.e. these blocks:
go to [something v]
point towards [something v]

Also, thinking a bit more about it, I don't see why it would be a blue sensor block – it has nothing to do with sensing (and that's potentially part of the problem with misconceptions).

Not sure what it would be in, though… A green operator block? An orange Data block?


Well it can be in a lot of categories. Probably either be sensing or operators though. I disagree with it being a data block, since it is not a variable you make.

Check out my four newest projects!

TheLogFather
Scratcher
1000+ posts

Color Variables

Pezd wrote:

Well it can be in a lot of categories. Probably either be sensing or operators though. I disagree with it being a data block, since it is not a variable you make.
Sensing doesn't make sense…

The Data pane contains blocks other than variables (“set”, “change”, “hide”, “show” are not variables), but they are all currently variable (or list) related, so it does seem slightly out of place at the moment, conceptually, even though it's the place that really makes most sense (since the “color” block *is* a form of “Data”)…

Maybe if there were other similar ‘constants’ in there, like <true> and <false>…? (Not that I particularly feel the need for such things, though they have been suggested…)

I can't see anywhere reasonable for this colour block other than Data or Operators, TBH (similarly <true> and <false>).

If they did go in the Data palette, I'd suggest they would have a different colour from variable blocks (just like lists are different).

Last edited by TheLogFather (April 17, 2017 14:52:20)


Siggy the Kumquat slayer:
Main account: DadOfMrLog –– Frameworks for basic pen-rendered 3D in scratch (see studio). Examples:

- - - - 3D Text - - - - - - Simple shapes - - - Controllable structures - - - On the ground - - - - - - In space - - - -

Pezd
Scratcher
100+ posts

Color Variables

TheLogFather wrote:

Pezd wrote:

Well it can be in a lot of categories. Probably either be sensing or operators though. I disagree with it being a data block, since it is not a variable you make.
Sensing doesn't make sense…

The Data pane contains blocks other than variables (“set”, “change”, “hide”, “show” are not variables), but they are all currently variable (or list) related, so it does seem slightly out of place at the moment, conceptually, even though it's the place that really makes most sense (since the “color” block *is* a form of “Data”)…




There are other variables in sections other than ‘variables’
(x position)
(size)
(volume)
(mouse x)
And so on…

Although all those variables are in sections that have things related to the variable.
I thought at first it should go into sensing since it has other color related blocks.
<touching color [#9b7b4f] ?>
<color [#206403] is touching [#58f5ec] ?>
But if we are putting it in a section with other blocks similar to it, then it might also go in pen.

I do see why you think it should be put in variables, but not only would it be out of place, I think it would also be hard to find.

Check out my four newest projects!

awesome5185
Scratcher
1000+ posts

Color Variables

jromagnoli wrote:

red_king_cyclops wrote:

So in Scratch there are a few blocks that use color boxes, that directly use a color instead of a number. So, what if there were variables that saved the color of something?

Here's an example of a block that could be based off color variables:
set [ vColor Variable #1] to [#534c0d]

Here is an example of how a color variable could be used:
<touching color (Color Variable #1) ?>
You can put hex codes in cloud variables.:
set [☁ score v] to (join [0x] (hex value))
<touching color (☁ score) ?>

What will set the (hex value) variable? You can't set a variable to a colour in the first place.

Pezd wrote:

Probably a block like this would be better.
It would report the color selected as a number.

(color [#FF0000]:: sensing
Support for this, and a lot more easier to use.

TheLogFather wrote:

Pezd wrote:

Wait a second. I never knew there was any of these blocks

(go to ())
(point towards ())
Oops! –Left the brackets in there. [Fixed!]

Meant:
go to (color [#ff0000] :: sensing)
point towards (color [#ff0000] :: sensing)

I.e. these blocks:
go to [something v]
point towards [something v]

Also, thinking a bit more about it, I don't see why it would be a blue sensor block – it has nothing to do with sensing (and that's potentially part of the problem with misconceptions).

Not sure what it would be in, though… A green Operator block? An orange Data block?

(color [#ff0000] :: operators)
(color [#ff0000] :: variables)

Isn't the other colour blocks sensing? The

go to (color [#ff0000] :: sensing)
point towards (color [#ff0000] :: sensing)

Will behave the same was as if the variable “variable” was “hello”

go to (variable)

Edit: There was a major Scratchblocks tag leak. 80% fixed now.

Last edited by awesome5185 (April 18, 2017 02:48:09)


Regards,
awesome5185

Featured Studio!
Ask Ouija!
Ask a question and get your answers one. letter. at. a. time. Join now!

; Santa Claus and Mrs Claus wanted to get a devorce. However, being in the north pole, there was no one there to help them do that. So they used a semi colon instead; they are great for seperating two independent clauses.
jromagnoli
Scratcher
1000+ posts

Color Variables

awesome5185 wrote:

jromagnoli wrote:

red_king_cyclops wrote:

So in Scratch there are a few blocks that use color boxes, that directly use a color instead of a number. So, what if there were variables that saved the color of something?

Here's an example of a block that could be based off color variables:
set [ vColor Variable #1] to [#534c0d]

Here is an example of how a color variable could be used:
<touching color (Color Variable #1) ?>
You can put hex codes in cloud variables.:
set [☁ score v] to (join [0x] (hex value))
<touching color (☁ score) ?>

What will set the (hex value) variable? You can't set a variable to a colour in the first place.
The hex value isn't a variable, it's just there to denote where you would put a hex number.




ROAD TO 10,000 POSTS
████████████████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 64%










If you can read this, my signature cubeupload has been eaten by an evil kumquat!
hehehe!Mytiptopsecrettopicidentifier!ahjdgggfhjadggahjsahasgdjfsdjfga

awesome5185
Scratcher
1000+ posts

Color Variables

jromagnoli wrote:

awesome5185 wrote:

jromagnoli wrote:

red_king_cyclops wrote:

So in Scratch there are a few blocks that use color boxes, that directly use a color instead of a number. So, what if there were variables that saved the color of something?

Here's an example of a block that could be based off color variables:
set [ vColor Variable #1] to [#534c0d]

Here is an example of how a color variable could be used:
<touching color (Color Variable #1) ?>
You can put hex codes in cloud variables.:
set [☁ score v] to (join [0x] (hex value))
<touching color (☁ score) ?>

What will set the (hex value) variable? You can't set a variable to a colour in the first place.
The hex value isn't a variable, it's just there to denote where you would put a hex number.
Ooh, I'd prefer an example lol. I get it now.

Regards,
awesome5185

Featured Studio!
Ask Ouija!
Ask a question and get your answers one. letter. at. a. time. Join now!

; Santa Claus and Mrs Claus wanted to get a devorce. However, being in the north pole, there was no one there to help them do that. So they used a semi colon instead; they are great for seperating two independent clauses.
PkmnQ
Scratcher
1000+ posts

Color Variables

Support, even though it has an easy workaround, I don't wanna learn all the colors, because there's

Wikipedia wrote:

16,777,216 colors
Thanks wikipedia.

Last edited by PkmnQ (April 19, 2017 09:38:13)


This is an account that exists.

Here, have a useful link:
The Official List of Rejected Suggestions by Za-Chary

awesome5185
Scratcher
1000+ posts

Color Variables

PkmnQ wrote:

Support, even though it has an easy workaround, I don't wanna learn all the colors, because there's

Wikipedia wrote:

16,777,216 colors
Thanks wikipedia.
Search up RGB and Hex colour picker for easy acess, you don't need to remember them..

Regards,
awesome5185

Featured Studio!
Ask Ouija!
Ask a question and get your answers one. letter. at. a. time. Join now!

; Santa Claus and Mrs Claus wanted to get a devorce. However, being in the north pole, there was no one there to help them do that. So they used a semi colon instead; they are great for seperating two independent clauses.
AwesomeDragon97
Scratcher
13 posts

Color Variables

There should be something like

set color of  [foo v] to [#d1ada7]

note: I couldn't figure out how to make it orange

Last edited by AwesomeDragon97 (Feb. 3, 2018 16:41:05)

Powered by DjangoBB