Hot answers tagged

54 votes
Accepted

Should I use "conventional" colors to represent item rarity?

Generally when there's a common convention that your audience may already be familiar with, the question isn't whether it's mandatory, but whether there's any reason to deviate from it. If you use a ...
DMGregory's user avatar
  • 132k
21 votes

Should I use "conventional" colors to represent item rarity?

The advantages to sticking with convention are: it works, and users are already familiar with it. The disadvantage is that you may be ignoring ways to improve and be unique. But on this subject, ...
congusbongus's user avatar
  • 14.8k
8 votes
Accepted

Pixel Picking vs Raycasting

Pixel picking is effective if you need to do lots of raycasts from one source. You bear the overhead of rendering and readback once, then get all your many picks at low incremental cost each. To get ...
DMGregory's user avatar
  • 132k
6 votes
Accepted

How do I get the object color?

Its actually simple. Just use Color32 class to get the r, b, g, a of your desired gameobject. Here is an Example Code. Here I used a cube gameobject and got the color of its material. ...
Shuvro Sarkar's user avatar
6 votes

What colour space or mixing algorithm should I use for "watercolor-like" colour mixing in-game?

To answer your question succinctly, RYB (red, yellow, blue) would be most intuitive and closest to mixing physical colors, aka pigments, which blend subtractively. To understand the mixing behavior ...
disc_code22's user avatar
5 votes
Accepted

Creating colour spectrum by light flux values

Here is a little help on getting you started with this rendering. This may not be the best way to accomplish this task however, it should work. First I created a structure to hold your data for ...
jgallant's user avatar
  • 8,374
5 votes

How to paint regions of a map with visually different colors

You could now go really deep into color theory to answer the question of what exactly makes two colors visually distinct. RGB is a color system for machines which doesn't map linearly to human ...
Philipp's user avatar
  • 118k
4 votes

How do I simulate color blindness for accessibility testing?

Windows 10 Settings In Settings app, there is a section of "Ease of Access".In this section, in the "Color filters" tab on the left, you can "Turn on color filters". This can simulate vision of ...
fakeinc's user avatar
  • 41
4 votes

How do I properly combine the colors of different lights?

Define "properly." There are multiple ways of blending color. Additive blending works as you describe, 0.1 + 0.1 = 0.2 because we don't care if this value goes ...
Draco18s no longer trusts SE's user avatar
4 votes
Accepted

What is the benefit of YCbCr?

Chroma subsampling is usually used with YCbCr, that makes pics smaller. Say, 512x512 pic in rgb takes 768 kb. While same pic in YCbCr with 4:2:0 subsampling will take 384 kb. Sure, that's good only ...
Vlad's user avatar
  • 306
4 votes
Accepted

Color Correction in DirectX

Color correction is commonly done through post processing shaders. Basically first you render the scene to a framebuffer, then draw a fullscreen quad that has a shader that takes that framebuffer and ...
Aaro's user avatar
  • 128
4 votes
Accepted

draw a box with transparent background (outline) in unity

You could use the "9-slicing sprites" technique to cut up a fairly basic sprite texture and use that to draw the borders. Start by creating a fairly simple sprite - this one is 16x16, but it could ...
Zhaph - Ben Duguid's user avatar
4 votes
Accepted

What makes a shader function with a LineRenderer?

Color on a LineRenderer is represented as a color property on the vertices themselves. It behaves just like other vertex properties such as position and UV coordinates. However, vertex colors are ...
Ed Marty's user avatar
  • 5,219
4 votes
Accepted

How can I build an accurate 15-bit Highcolor RGB palette

It took a little while to stumble across and my understanding of bit operations is limited, but this discrepancy appears to be due to the data loss suffered when converting values from 24-bit to 15-...
baseten's user avatar
  • 171
4 votes
Accepted

Are there any practical applications for clearing the screen with a specific color?

Clearing the color buffer can be optional. For example, if you know that you're going to overwrite every pixel each frame, then you might decide to not clear at all. On the other hand, some drivers ...
Maximus Minimus's user avatar
3 votes
Accepted

How do I properly combine the colors of different lights?

Your question makes it clear what you don't want, i.e. a combination of a color like (0.1,0.1,0.1) with itself to result in pure addition, giving ...
MAnd's user avatar
  • 4,907
3 votes

UI Text Won't Change Color in Unity 5

I got stuck on this same thing in this tutorial. My fix was to assign the font material to the text component's material directly underneath where you change it red.
Jared Browne's user avatar
3 votes
Accepted

Is this converting from or to premultiplied alpha?

This code is converting from premultiplied alpha: Expanding one of the assignments by substituting for divAlpha: ...
Pieter Geerkens's user avatar
3 votes
Accepted

Monogame - how to make a smooth color transition with Color.Lerp()?

If you look at the Color.Lerp documentation you'll notice that the third parameter is the amount. ...
craftworkgames's user avatar
3 votes
Accepted

How to get a pixel color from a specific sprite on touch (unity)?

I sample image data for my color picker utility. Raycasting will effectively return all objects that were clicked on, regardless if they appear underneath another one. So first, you need to ...
jgallant's user avatar
  • 8,374
3 votes
Accepted

SDL_LoadBMP into glTexImage2D results in scewed colors

You are checking how many bytes there are per pixel, but you are not checking how colours are ordered, and it could be RGBA or BGRA (or possibly something else). You need something like this instead ...
sam hocevar's user avatar
  • 23.8k
3 votes

What is the best way to avoid colorblind issues?

You can use this palette from the article Color Universal Design (CUD) - How to make figures and presentations that are friendly to Colorblind people - by Masataka Okabe and Kei Ito. Another option ...
Philipp's user avatar
  • 118k
3 votes
Accepted

The meaning of colours in other cultures

Color symbolism in non-Western cultures (and even among Western cultures) is definitely incongruent. However, with regards to video games, typical Western and Japanese color symbolism is pretty ...
Jesse Williams's user avatar
3 votes

Game Design: Colour units per team or per unit type?

Use colours for team identification and shapes and sizes for individual unit type differentiation. This means enemies and friendlies are instantly distinguishable, and unit types look distinct whilst ...
Huxellberger's user avatar
3 votes

Game Design: Colour units per team or per unit type?

Humans are usually far better at spotting something of a different color than something of a different shape. Here is an example of an image with some blue pentagons: Among them is a red pentagon and ...
Philipp's user avatar
  • 118k
3 votes
Accepted

How to achieve this kind of look of a cube in a most efficient way?

I will be giving you two answers, The one for your actuall problem,and another one with a cube that has faces colored based on how much they are facing top: To simply create a Cube like that: Create ...
Guilherme Junqueira Coutinho's user avatar
3 votes

What exactly is the "blend factor" t in Color.Lerp?

The other answers correctly explain how the parameter works when you're using it something like this: ...
DMGregory's user avatar
  • 132k
3 votes
Accepted

Why only few parts of the 2D sprite change their colour when I apply sprite color in Unity?

You've mentioned that the rest of your pixels stay black. The way SpriteRenderer.Color is applied is via multiplication. The mentioned color field does not replace the pixel color but "tints" it. So ...
mt_'s user avatar
  • 576
3 votes
Accepted

Color of Image changes to white between 2 positions using Color.Lerp - Unity

This is because you are using Color as if it was a Color32. Color uses (float) values between 0 and 1 Color32 uses (byte) values between 0 and 255. So a value greater then one is clamped to 1 for ...
troien's user avatar
  • 906

Only top scored, non community-wiki answers of a minimum length are eligible