Get rgb/hsb block

A feature I’d like to see in Hopscotch is:

Fetch rgb/hsb block. It basically gets the color from an item and puts it in a variable of your choice.

I’d use it for this type of project:

You can use it to convert from rgb to hsb without having to write a lot of code.

Here are some examples of Hopscotch code that could be improved if we had this:

Easier rgb to hsb converter or hsb to rgb converter.

Here is an example design I’ve made:

Here is a small video explaining it because I like making videos.

I’ve seen something similar in another programming languages, it looks like this: I have not seen this before.

How good is the idea from 1-10? (1=no we don’t need it, 10=YESSSS I NEEEED)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

0 voters

6 Likes

Stealing first post. Any suggestions to make this better?

3 Likes

I think this is very useful!

Although you could recreate this with variables

1 Like

Not really sure about this since it just seems like an oddly specific feature and doesn’t seem necessary as a language feature. Like, I don’t know a language where RGB to HSB is a function without a library.

It’s definitely a cool idea though.

Also, what would you use it for, other than a converter? Generally, a block should have use for more than one type of project, imo.

3 Likes

Art pads, pixel art generators, converters,

2 Likes

Seems cool, but you can recreate this with carefully placed variables. Yes, they are hard to understand, but they do give Hopscotchers a good challenge, which keeps them from being too bored.

This project has a RGB to HSB / HSB to RGB / RGB to Hexadecimal / Hexadecimal to RGB converter that does it in real time (sort of).

3 Likes

this is to get the rgb/hsb of an object—I think you’re talking about just a conversion thing?

4 Likes

An object variable called ((self) color) would be cool. Of course we would first need variables that can store different data types such as color first.

3 Likes

Oh yesss yes yes yes

I’ve always wanted that

You can store RGB / HSBs data anyway, so I personally don’t think this is needed


2 Likes

I’m talking more about other color data types such as Hexadecimal (#7a68fe), which have to converted to HSB or RGB in order for it to work in a set color block.

3 Likes

Yes, you can give an object some color through variables, but there’s no way to retrieve the color of the object, especially if they weren’t manually set via HSB or RGB colors.

2 Likes

I’m confused
The color is stored in variables, so can’t you retrieve it that way?

2 Likes

I mean if you used a preset color, there’s no way to easily tell what HSB or RGB it is.

2 Likes

Ohhhhhh
Actually, there’s a glitch where you can find the HSB /RGB for any preset color but I understand that this could be useful

1 Like

Oh, I see. Yeah, that would be really useful. Maybe something like this?

4 Likes

how would layering objects affect that—would it just detect the color of the pixel or would it get the color of the object with the highest z index?

4 Likes

ig it’ll get the color visible by the player
so the object with the highest z index

4 Likes

would it detect the overall color if there were two semi-transparent objects overlapping?

6 Likes

That would be really cool. And I see you used values from the center of a 1024x768 size screen. Would be useful for retrieving colors from trails.

I also think it would be cool if we were able to detect colors touching other colors like in Scratch, but that a whole different story.

5 Likes