Help with finding complimentary colours in Hopscotch

hopscotch
helpwithcode

#1

Does anyone know how to find a colour complementary to an RGB or HSB colour? I tried searching it up online, but it just came up with a bunch of tools that find complementary colours for you.

Thanks in advance!

EDIT: I'm talking about complementary colours on paper (red and green, blue and orange, purple and yellow, etc.), not light. Sorry I didn't make that clear before.


#2

what do you even mean? Are you talking about something like CMYK, YUV, or Hex? Or actual colors?


#3

I'm pretty good with HSB but I have never heard of this before. XD


#4

For HSB, maybe you could add 180 to the H value since complimentary colors are on opposite sides of the color wheel. For the S and B values, I don't really know, maybe keeping them the same would work out.

I don't really know much about RGB, but looking at some color wheels with RGB, I guess you could subtract the values from 255. Like RGB(0,0,255) (blue) turns into RGB(255,255,0) (yellow).

These are just my guesses. :P


#5

@Fishyguitars
Sorry, I was talking about complementary colours on paper (blue and orange, purple and yellow, red and green, etc.), not light. Sorry if I was unclear.

Thanks anyway! :)


@Steelhooves
Sorry if I was unclear, here's a better explanation:

I meant having two variables, "Hue" and "Hue 2" (for HSB) or six variables, "Red", "Green", "Blue", "Red 2", "Green 2", and "Blue 2" (for RGB).

With HSB, "Hue" would be equal to whatever hue you want. What I'm asking is how to find a value for "Hue 2" that would make a colour with hue "Hue 2" complementary to a colour with hue "Hue".

With RGB, I'm asking how to find values for "Red 2", "Green 2", and "Blue 2" that would make RGB("Red 2", "Green 2", "Blue 2") complementary to RGB("Red", "Green", "Blue").


@Kitkat26
Do you mean you don't know what complementary colours are, or something else?

If you don't know what complementary colours are, they're basically just colours opposite each other on the colour wheel.

If not, what do you mean?



#6

Try http://paletton.com/


#7

I was asking how to program something in Hopscotch that finds a colour complementary to another colour, not for a website that does it automatically.

Thanks anyway, though! :)


#8

Oh okay, that makes sense. Maybe something like

If (hue) < 180
{
-set (hue2) to (hue + 180)
}
else
{
-set (hue2) to (hue - 180)
}?


#9

Yea basically what you said. Ugh I'm so not artsy XD


#10

This?


#11

@Mathgirl Click a circle to select the value to change.


Top hue goes to left, bottom hue goes to right.

Top row to left, bottom row to left.


#12

@Mathgirl hope that helped.


#13

Sorry for the really, really late reply — it sometimes takes me a long time to figure out how to respond to things (sometimes even a few months), even if they shouldn't be that hard to respond to.


Anyway, thanks for trying to help, but I meant complimentary colours with pigments. (colours on opposite sides of the colour wheel) Sorry I wasn't clear about that.


#14

oh yeah... not light


#15

Does anyone know how to do this?


#17

@Mathgirl I did some Google searching, and didn't find anything very helpful, so I just decided to do some random testing. I don't really have a solid answer yet, but I think it might be something to do with switching the largest and the smaller values with each other.

For example, RGB 255/150/0 is orange.
Swap the largest and smallest values (255 and 0) so it becomes 0/150/255, which is blue.

RGB 230/90/170 is pink.
To get a light green, swap the values to get 90/230/170.

There are some exceptions, I think, for example when two of the values are the same (RGB 255/0/0, which is red). In which case, green is RGB 0/255/0. Blue, on the other hand, is 0/0/255 but neither 255/0/0 or 0/255/0 are orange.

Hope this is kinda helpful, it is probably really random


#18

This is interesting, I would have suggested numerically opposite HSB/RGB values like @Steelhooves said. but the colour wheel for art is something arbitrary, made by people, so i guess we can't describe it in a really mathematically precise way.

I was reading something on Canva that I can try to link later, but I used it in this project and just used 360 - Hue for these ones here:

Edit: I have the link that I was looking for but it doesn't have as much specific information, it's just some general ideas on color from Canva.