how to set color ?

Not favoritedFavorited Favorited 0 favourites
  • 13 posts
From the Asset Store
Color all tiles with the same color in 22 moves or less!
  • Does anyone have a color palette? No matter how many times I try a color set, it doesn't change to the color I want, it only sets black and something similar. I've been trying for over half an hour.

    It's incredible how complicated these little things are to do.

  • Have you checked the luminosity slider at the bottom of the main color picker?

    If it's all the way to the left no matter what color you pick it will be black.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I want the white sprite to be the color that is at the top but the result is the one below

    I have already tried with all the colors and codes on the web and with these below

    That's why a color palette is enough for this program.

  • Multiply those values by 100/255.

    I don't understand why though!!!

    😆

  • I just want to change it to the desired color, but I've already given up. I think it's easier to make a 2-sprite animation and that's it. I've already spent an entire afternoon because of that. Thanks, gentlemen.

  • I see, I misunderstood what you were trying to do.

    To use the RGB values as they appear in the animations editor you should use the rgbEx255 expression or the rgba255 expression, these accept values in the 0-255 range.

    rgba and rgbEx accept values in the 0-1 range.

    If you are not interested in the alpha channel use the Ex variants, those only accept red, green and blue values.

  • DiegoM Actually the 0-1 range is only for when using it in the plugin SDK. If you use the expression in events it's 0-100. According to construct.net/en/make-games/manuals/construct-3/system-reference/system-expressions

    But I still don't understand the purpose of rgba() and rgbEx() with the values from 0-100. Not a single program I've ever used in my entire life did use 0-100 for setting RGB-colors. Except Construct. I guess it's easier to set something to 30% red, but that's such a specific thing I don't think I've ever needed that. Anyway, I'm glad there's still the variants that just take 0-255 values.

  • Let's try again, thank you very much for your patience. I'm in this because of Joby. I know absolutely nothing about programming. Everything I've done is through tutorials, searching and help in the forums. And even though I don't know anything, Construct is very fun.

  • Oh right! I also went to the docs to check, but I misread :P

    But I still don't understand the purpose of rgba() and rgbEx() with the values from 0-100. Not a single program I've ever used in my entire life did use 0-100 for setting RGB-colors. Except Construct. I guess it's easier to set something to 30% red, but that's such a specific thing I don't think I've ever needed that. Anyway, I'm glad there's still the variants that just take 0-255 values.

    I wasn't going to go into detail, because it seemed a bit off topic, but since you are mentioning it...

    The 0-255 range is a relic of the past which just refuses to die and it looks like it won't be dyeing any time soon.

    The 0% to 100% range makes a lot more sense conceptually, 0% is no color and 100% is all the color, every position in the middle is valid. This allows the notation to represent essentially an infinite amount of colors, where with 0 to 255 you have a workable, but in comparison very limited amount of values, because there are no fractional values.

    Using a single byte to represent a color channel was introduced at a time where using a 64 bit floating point value to do the same was impossible.

    I guess the main reason it is still used, is for backwards compatibility. There are some really old file formats floating around and they are still supported, so that means that new programs still need to understand that color information can be stored in individual bytes.

    You can also never underestimate the power of familiarity, there are a lot of people that will just not question that 255 is the maximum value a color channel can have. And so the range continues to be used. I am pretty sure that all popular image editing software uses the 0% - 100% range under the hood, but presents the legacy format in the UI.

    In Construct there really is no reason to support the 0 - 255 range, other than backwards compatibility and user familiarity with the format. It literally offers no benefits.

  • supergameweb.com

    If you take the event you showed before, and replace rgba with rgba255 it should work. Just tried it out myself.

  • Problem solved. I worked as you explained and it worked. Thank you very much. I appreciate it.

  • Thanks for explaining ^^ I suppose it makes sense in a way.

  • Interesting take to consider the 0-255 range a relic. It’s standard to represent a pixel with a 32bit integer or 8bits (0-255) per component. That’s used in textures, the screen and when you snapshot a drawingCanvas.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)