Hot answers tagged

54

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 colour scheme compatible with the ones used in WoW, GW2, Destiny, etc. then players who have played one of those games will have one less thing to learn to ...


42

To me it makes no sense at all. This theory is probably just an artist sense of white balance compensation that the eye does, and wrongly gives us the feeling of shifted hues in the shadows. A shadow is just the absence of light from the considered light source. There are other light sources often in a realistic world, this is their color that comes in place....


40

Digital colors can be made up of three components: red, green, and blue. Combine these together, and you get final color, eg. yellow is 100% red, 100% green and 0% blue. The fourth component is, as you mentioned, transparency. Together, these form the tuple RGBA (red, green, blue, alpha) which represent an image. Now, instead of pixels, think about it ...


32

You can use the fact that colors make up a (three dimensional) color space and calculate a distance in this color space. You then need to define a metric in this color space to find the distance between two colors. E.g. the distance in a euclidean space between two points x = (x1, x2, x3) and y = (y1, y2, y3) is given by d(x,y) = sqrt( (y1-x1) * (y1-x1) + (...


21

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, there's not much convention. This topic is covered at Giant Bomb and TVTropes, and from their analysis, generally grey/white items are the lowest tiers, but after ...


20

There does exist a flavour of Wavefront's *.obj that facilitates Vertex Coloring.. I know of two applications that can export these namely "MeshLab" (free) and "MeshMixer" (also free from Autodesk).. The vertex colours is actually found just after each vertex definition as shown below.. (Piece of *.obj) #### # # OBJ File Generated by Meshlab # #### # ...


19

Hue-shifting is one possibility that would let you get a range of colors without losing the color details. The basic idea is to convert each pixel from RGB to HSV space, then offset the hue by a user-defined amount, then convert back to RGB. Actually, this can be done more efficiently by applying a rotation matrix to the RGB values: create a matrix that ...


16

Let _colors be an array of colors let LENGHT be the number of colors in the array let t be the 0..1 float value float scaledTime = t * (float) (LENGHT - 1); Color oldColor = _colors[(int) scaledTime]; Color newColor = _colors[(int) (scaledTime + 1f)]; float newT = scaledTime - Mathf.Round(scaledTime); finally you can use Lerp Color.Lerp(oldColor, ...


14

I don't know if there exists a set of colors that all people will be able to differentiate, whether or not they have any color-blindness. It might be a better idea to use an additional indicator alongside color. I know that the Ticket To Ride boardgame uses a symbol on each of the different color cards, so that if someone can't tell the difference between ...


14

For drop-shadows it doesn't work very well for the reasons you already stated. You never know how many drop-shadows you will have in the scene and differently colored shadows from different objects can look strange. However, it can work nice for self-shadows, especially in a 2d game. This screenshot is from Seiken Densetsu 3 (Squaresoft 1995): Notice how ...


13

White is the best base color for true representation. Also keeping your sprite grayscale can make for some easy color adjustments for teams, etc. Unity applies a Multiply blend mode to the sprite texture and color. Unity's Color type is ranged from 0 to 1 inclusive. Color.White is equal to (1, 1, 1, 1). Knowing that 1 times anything is itself. If the ...


12

One approach that can be taken with multiple color transitions is to leverage a Gradient. By exposing a public variable of this type a developer an use the Inspector to launch the Gradient Editor to design a gradient containing any number of colors. This editor allows you to use a the unity color pickers, fine tune placement of the color/alpha keys and ...


10

It's much more complex than that. It's not the colors themselves that look attractive, it's the combination of colors, the contrast between them. In a picture only out of bright colors, there is a lack of contrast, same for a picture only consisting out of dull colors. In a picture out of dull colors bright spots will immediatly jump into the eye, this can ...


10

The problem you are facing is that you can't simply "tint" the whole image, the appearance you see is more than just a base color. For one you have fine gradients from one one material to the other, but more importantly you also have reflections,highlights and shadows, which are not influenced by the base color. (Those are basically added on top of it.) So ...


9

If you use alpha blending you can lay down a complimentary shadow that will work against any background. It may or may not be any better or faster though. This is something that is likely to change depending on your specific game. I don't have enough rep to comment on @v.oddou's answer, but I want to say that while purposefully making shadows complimentary ...


8

The United Nations web accessibility standards page (http://www.un.org/webaccessibility/1_visual/13_colourcontrast.shtml) does indicate a standard for ensuring proper text contrast on websites, keeping in mind that some users are colorblind. This might be particularly important for you since some of your users may be colorblind as well (would be hard to tell ...


8

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 just one ray result you've already had to calculate thousands or millions whether you use them or not. If you're only doing a few raycasts at a time (say a ...


7

You can do just like the Firefly Studios have done in their Stronghold series. In the bottom right corner of the picture you can see six colors, that can be easily distinquished. As a player, I do not mind remembering who is my enemy and you can always give the player(s) a chance to assign colors to the teams. One thing I have to note, is that in the first ...


7

This live demo uses the algorithm described by @Dries in a fragment shader to colorize the incoming fragment color. It basically can be summarised by: vec4 getInputColor() { TODO: sample from a texture / use a uniform var / varying ... } vec4 toGrayscale(in vec4 color) { float average = (color.r + color.g + color.b) / 3.0; return vec4(average, ...


6

If you want to have a colour-picker with Hue on one axis and Saturation on the other, it might be good to think of your colours in terms of the Hue-Saturation-Value (HSV) or Hue-Saturation-Lightness (HSL) colourspaces instead of Red-Green-Blue (RGB). There's no magic going on here -- HSL and HSV are just another another way of thinking about colour. ...


6

JPG is lossy. Don't use that for sprites -- you will end up with nasty artifacts that will look bad. There's a couple reasons you might want to use colur-keying, but they're a bit lost in todays hardware. Taking a quick look at color key advantages: Pros They use up less disk space -- there is no alpha channel to store By consequence, their memory foot ...


6

Another way to do this is to make a texture that maps each RGB to a colour on the palette, an image like this (from the NES colours): Then in a post processing shader you can the RGB colour from your regular image in a way like this: uniform sampler2d paletteMapping; vec3 mapColor( vec3 realColor ) { vec3 mappedColors = floor( realColor * 16 ); ...


6

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 parsing from text file: public struct Data { public Data(float x, float y, float value){ X = x; Y = y; Value = value; } ...


6

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. public class FirstScript : MonoBehaviour { // Use this for initialization void Start () { Color32 objColor; objColor = gameObject.GetComponent<MeshRenderer>...


6

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 of RYB color-space, see both the color wheel diagram in the question, as well as the color tree below. For your use case it seems to me it would be simplest to ...


5

There's a list of software to simulate color blindless here, on Daltonize.org. The shame is that most of the links are dead. One listed entry is Visolve, which seems to be relatively serious commercial software. If it really transforms the entire computer display colors, then that would be a perfect fit, if you're OK with paying the price. Side note: if I ...


5

Alpha channels were actually invented by George Lucas's company Industrial Light & Magic (actually Alvy Ray Smith did most of the work while working there, who was previously employed by Xerox PARC - who we can thank for almost everything in modern computing!). Alpha channels, in addition to doing cool effects like transparent window, transparent ...


5

Objects are rarely lit entirely by a single point light source. In most cases, objects will receive much of their illumination from a dominant point source, but receive additional illumination from other point or sources, including some diffuse light which has been scattered by either by other objects or (for outdoor scenes) by the atmosphere. If an object ...


5

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 perception. So if you want a really good formula, then it can get amazingly complex. And if you want your game to be accessible for people with various forms of ...


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