Discuss Scratch

NotK3ndricAlt
Scratcher
1000+ posts

Hacked block? (Anyone know what this does?)

I was trying to make a project with the simplest 3D engine (well, actually 2.5D but it introduces to real 3D programming) but then I found this block.
set pen color to (0) // hacked??? :O
Could this be a LEGACY hacked block? Because yes, the project was made 1 day after Christmas 2014. Extension task if you can do it: Could someone tell me how to use this block?
yadayadayadagoodbye
Scratcher
1000+ posts

Hacked block? (Anyone know what this does?)

You could likely input a rgb value in there, as I believe scratch pens use those
I belive the equation to convert RGB to a single number is as follows:
(R*65536)+(G*256)+B
NotK3ndricAlt
Scratcher
1000+ posts

Hacked block? (Anyone know what this does?)

yadayadayadagoodbye wrote:

You could likely input a rgb value in there, as I believe scratch pens use those
I belive the equation to convert RGB to a single number is as follows:
(R*65536)+(G*256)+B
RGB values? Well I do know math, but not RGB math. Tell me how this works.
ilovestories
Scratcher
1000+ posts

Hacked block? (Anyone know what this does?)

If the block's like the present set pen color block (below), it works a bit like the color effect block.
set pen [color v] to [] ::pen
I don't know if it does work like it, though.
yadayadayadagoodbye
Scratcher
1000+ posts

Hacked block? (Anyone know what this does?)

NotK3ndricAlt wrote:

yadayadayadagoodbye wrote:

You could likely input a rgb value in there, as I believe scratch pens use those
I belive the equation to convert RGB to a single number is as follows:
(R*65536)+(G*256)+B
RGB values? Well I do know math, but not RGB math. Tell me how this works.
RGB values are values with 3 numbers: a R value, a G value, and a B value.

Each of these 3 values corresponds to the amount of red, blue, or green in a pixel, with each value going up to 256 and down to 0. To get the “single number” version of the values, simply do (R*65536)+(G*256)+B
NotK3ndricAlt
Scratcher
1000+ posts

Hacked block? (Anyone know what this does?)

yadayadayadagoodbye wrote:

NotK3ndricAlt wrote:

yadayadayadagoodbye wrote:

You could likely input a rgb value in there, as I believe scratch pens use those
I belive the equation to convert RGB to a single number is as follows:
(R*65536)+(G*256)+B
RGB values? Well I do know math, but not RGB math. Tell me how this works.
RGB values are values with 3 numbers: a R value, a G value, and a B value.

Each of these 3 values corresponds to the amount of red, blue, or green in a pixel, with each value going up to 256 and down to 0. To get the “single number” version of the values, simply do (R*65536)+(G*256)+B
Yeah, that?
(((R) * (65536)) + ((G) * ((256) + (B))
yadayadayadagoodbye
Scratcher
1000+ posts

Hacked block? (Anyone know what this does?)

NotK3ndricAlt wrote:

yadayadayadagoodbye wrote:

NotK3ndricAlt wrote:

yadayadayadagoodbye wrote:

You could likely input a rgb value in there, as I believe scratch pens use those
I belive the equation to convert RGB to a single number is as follows:
(R*65536)+(G*256)+B
RGB values? Well I do know math, but not RGB math. Tell me how this works.
RGB values are values with 3 numbers: a R value, a G value, and a B value.

Each of these 3 values corresponds to the amount of red, blue, or green in a pixel, with each value going up to 256 and down to 0. To get the “single number” version of the values, simply do (R*65536)+(G*256)+B
Yeah, that?
(((R) * (65536)) + ((G) * ((256) + (B))
no, the green is the one being multiplied by 256, its not being multiplied by (256+B) lol

it'd be
(((R) * (65536)) + (((G) * (256)) + (B)))
or (this one is more clear)
((((R) * (65536)) + ((G) * (256))) + (B))
Fun_Cupcake_i81
Scratcher
1000+ posts

Hacked block? (Anyone know what this does?)

I believe it just functions the same as
set pen color to (my variable)
. (Which accepts hex codes including the # at the beginning)

(This is just a guess, though.)

Last edited by Fun_Cupcake_i81 (Dec. 16, 2023 01:16:24)

medians
Scratcher
1000+ posts

Hacked block? (Anyone know what this does?)

Okay let me explain:

https://en.scratch-wiki.info/wiki/Set_Pen_Color_to_()_(number_input_block)
https://en.scratch-wiki.info/wiki/Set_Pen_Shade_to_()_(block)
Shade was replaced with brightness and the color and that was also put into the dropdown, well kinda. They didn't actually remove the original blocks but yea they hid it from the block palette (it was in 1.x). Also this block goes from 0 to 200 instead of 0 to 100.

Last edited by medians (Dec. 16, 2023 02:56:42)

Powered by DjangoBB