Train Colors in HSV

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Use HSV for colour picker (locomotive, etc.)

Post by mrvn »

Atlas wrote:HSV sounds good to me.
Another option would be the system that is used in GIMP, where hue is on the slider and brightness and saturation are in a square.
Note that the hue has more values than the brightness and saturation. But your GUI elements have the same size. Also with brightness or saturation down there are less colors to choose from. This reflects nicely in the color wheel. The hue is around the rim, which gives the largest amount of choices while white (or black) is in the middle giving only one choice. Radially the choices increase from the middle to the edge reflecting the number of colors actually available for each saturation/brightness level.

I never understood why GIMP uses squares. Just too lazy to do the polar/rectangular conversion required?
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Use HSV for colour picker (locomotive, etc.)

Post by bobingabout »

mrvn wrote:Note that the hue has more values than the brightness and saturation.
Not always true.

I've seen Hue scaled from 0 to 240, 256 and 360 before, depending on program.

I think 240 was in MS-Paint, perhaps on windows XP.
256 makes sense for computer numbers, because it's 8 bit.
And the 360 makes sense if you think of it as a wheel, because it's 360 degrees.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Use HSV for colour picker (locomotive, etc.)

Post by mrvn »

bobingabout wrote:
mrvn wrote:Note that the hue has more values than the brightness and saturation.
Not always true.

I've seen Hue scaled from 0 to 240, 256 and 360 before, depending on program.

I think 240 was in MS-Paint, perhaps on windows XP.
256 makes sense for computer numbers, because it's 8 bit.
And the 360 makes sense if you think of it as a wheel, because it's 360 degrees.
But in the end you generate RGB values from it. With just 240 hue values you can't reach all RGB values. On the other hand with saturation at 0.9 (or 95 or 250 or whatever is near the max for you) there aren't 240 RGB values that have that saturation. That's why I think a slider is a bad representation of the data.
User avatar
Jon8RFC
Filter Inserter
Filter Inserter
Posts: 554
Joined: Tue May 10, 2016 3:39 pm
Contact:

Re: Use HSV for colour picker (locomotive, etc.)

Post by Jon8RFC »

HSV does feel simpler when I tinker with this specific implementation, but even the RGB selector is easier because it adjusts the other two sliders in real-time:
http://colorizer.org/

Having the slider backgrounds adjust like that seems ideal.
Image
diederTheBeater
Inserter
Inserter
Posts: 32
Joined: Tue Apr 25, 2017 6:51 pm
Contact:

Train colors in HSV color format

Post by diederTheBeater »

Currently train color is set in RGB, but RGB is known to be not very human friendly.

I suggest changing the GUI to use HSV color format. It can be directly converted to RGB internally, which suggests its probably very easy to implement (https://en.wikipedia.org/wiki/HSL_and_HSV)

Currently its very difficult to create two trains with the same hue, one lighter than the other (ore transport, iron transport)
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Train colors in HSV color format

Post by bobingabout »

I do like the HSV/HSL systems when dealing with sliders like presented with here.

I once actually wrote a calculator for Yuri's Revenge that translated RGB -> HSB and back for dealing with custom colours for factions and multiplayer options. My mods back then added a heap, but figuring out what colour it actually was wasn't easy when most art programs use HSL, and the RA2 engine used HSV. not to mention scales can be different, I've seen hue in scales of 240, 256 and 360. it's fairly obvious why they all exist, 256 doesn't have 3/6 equal decisions, but 240 and 360 do. not to mention when hue is drawn as a circle, 360 degrees makes sense. I tihnk it was MS Paint (before windows 10) that used HSL with a hue of 240.

I've seen odd numbers used for the Saturation, value and Lightness too, 100, 240 and 256 again etc. Lightness since it goes between Black and White through colour I've seen represented as -100 (black) to 100 (white), so that's 201 possible values. You can pretty much do whatever you want.

Personally, I am more of a fan of HSV when dealing with sliders than HSL, and IMO, the perfect scale would be 6x256 for hue, with 256 for Saturation and Value. this would account for every possible colour combination, but you could instead go with 6x64 instead, which is 384, depends how accurate you want the colours to be. the big thing to avoid is something that doesn't divide exactly by 6, otherwise you end up where you can't quite exactly make the key points, yellow, green, cyan, blue and magenta... not that it matters when looking at something that isn't being analysed by a computer.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
diederTheBeater
Inserter
Inserter
Posts: 32
Joined: Tue Apr 25, 2017 6:51 pm
Contact:

Re: Train colors in HSV color format

Post by diederTheBeater »

Whatever is the final choice, everything is better than RGB as its the most unhumanreadable format
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3234
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Train colors in HSV color format

Post by BlueTemplar »

Might as well make it future-proof and go with "HDR/UHD" colors then : (BT2020 below)
Image
(And whatever format is the most appropriate for that, you'll certainly need more than 8 bits = 256 values per color...)
BobDiggity (mod-scenario-pack)
Koub
Global Moderator
Global Moderator
Posts: 7918
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Train Colors in HSV

Post by Koub »

[Koub] Merged into older topic with same suggestion.
Koub - Please consider English is not my native language.
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Use HSV for colour picker (locomotive, etc.)

Post by mrvn »

Atlas wrote: Mon Feb 12, 2018 11:39 am HSV sounds good to me.
Another option would be the system that is used in GIMP, where hue is on the slider and brightness and saturation are in a square.
While that is simple to draw I think the color wheel represents the color space better. You have white in the center and the rainbow all around the rim. Brightness as extra slider at the side or bottom. And there is really nothing preventing having the RGB sliders right next to it as well.


But what I really want to see is icons for the trains. My coal train should have a coal icon. Make it up to 4 icons like blueprints.
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3234
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Train Colors in HSV

Post by BlueTemplar »

No, the color wheel is pretty bad at representing color spaces, as anyone that tried to do hue shifts can tell you.
The least bad color space representation that we have is the CIE U'V' one that I've posted - with RGB values in that triangle.
One reason that can't be faithful is that the human color space is shaped more like a pleated disk : (and even then, not as regular as a disk on the edges)
Image
(And it gets even more complicated, with non-Euclidean color volumes, when you start to consider brightness...)
BobDiggity (mod-scenario-pack)
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Train Colors in HSV

Post by mrvn »

BlueTemplar wrote: Thu Mar 21, 2019 11:01 am No, the color wheel is pretty bad at representing color spaces, as anyone that tried to do hue shifts can tell you.
The least bad color space representation that we have is the CIE U'V' one that I've posted - with RGB values in that triangle.
One reason that can't be faithful is that the human color space is shaped more like a pleated disk : (and even then, not as regular as a disk on the edges)
Image
(And it gets even more complicated, with non-Euclidean color volumes, when you start to consider brightness...)
I didn't mean represent the human color space but represent the colors you can set on the computer. In the end it's all just RGB and there is only one white. Which is the dot in the center of the wheel. But as saturation goes up there are more and more colors you can represent which coincides with more and more pixels on the wheel as you go outwards. The outside of the wheel can cover the whole 6 * 256 color choices you have at full saturation.
User avatar
mexmer
Filter Inserter
Filter Inserter
Posts: 870
Joined: Wed Aug 03, 2016 2:00 pm
Contact:

Re: Train Colors in HSV

Post by mexmer »

Arch666Angel wrote: Wed Mar 15, 2017 1:32 pm It should be a slider for the wavelenght of the photons.
definetly this.
ManaUser
Filter Inserter
Filter Inserter
Posts: 263
Joined: Sat Aug 12, 2017 9:41 pm
Contact:

Re: Train Colors in HSV

Post by ManaUser »

What about adding presets? Personally I'd say keep the current RGB values, but add buttons for common colors. Kind of like how you can set your player color using either /color ### ### ### or /color <colorname>.

I admit I don't know what other people use train colors for, but my main goal is to have them distinguishable, and maybe vaguely related to the color of the product they carry, just a mnemonic. It seems like that might be accomplished more easily with presets than sliders.
Pin-Lui
Inserter
Inserter
Posts: 27
Joined: Fri Apr 01, 2016 12:09 pm
Contact:

Re: Train Colors in HSV

Post by Pin-Lui »

All Hail RGB Overlord. there is nothing easier than memorizing a few numbers. I have over 100 stations at the moment and when i do new one i just punch in the numbers and have the EXACT same color as all other station. it may be not Intuitive. but it is fast efficient and exact. Just imagine i had to mess with sliders pallets and scales on over 100 stations..... just my opinion
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Train Colors in HSV

Post by mrvn »

Pin-Lui wrote: Thu Mar 21, 2019 12:34 pm All Hail RGB Overlord. there is nothing easier than memorizing a few numbers. I have over 100 stations at the moment and when i do new one i just punch in the numbers and have the EXACT same color as all other station. it may be not Intuitive. but it is fast efficient and exact. Just imagine i had to mess with sliders pallets and scales on over 100 stations..... just my opinion
HSV or RGB are both just 3 numbers. Nobody is saying to eliminate the number fields.
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3234
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Train Colors in HSV

Post by BlueTemplar »

mrvn wrote: Thu Mar 21, 2019 11:57 am I didn't mean represent the human color space but represent the colors you can set on the computer. In the end it's all just RGB and there is only one white. Which is the dot in the center of the wheel. But as saturation goes up there are more and more colors you can represent which coincides with more and more pixels on the wheel as you go outwards. The outside of the wheel can cover the whole 6 * 256 color choices you have at full saturation.
The whole issue is that it's NOT all just RBG, and sRGB is on the way out (albeit slowly, especially on the Web)... also technically there is not only one white (see the temperature curve above).

Yes, I know, since we're strictly talking about Factorio this might seem a little bit academic, but it seems to me that this discussion will go nowhere if people are unaware of these colorimetry basics...
mexmer wrote: Thu Mar 21, 2019 11:57 am
Arch666Angel wrote: Wed Mar 15, 2017 1:32 pm It should be a slider for the wavelenght of the photons.
definetly this.
That's a bad idea, wavelength is 1D, while the human color space is 2D+
Also, sRGB is unable to represent any "pure wavelength" colors, as these lie outside of that color space :
Image
If I'm not mistaken, they are the outside curved line with the numbers (wavelength in nm) on the above graph - sRGB being the white triangle.
BobDiggity (mod-scenario-pack)
User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Train Colors in HSV

Post by Arch666Angel »

mexmer wrote: Thu Mar 21, 2019 11:57 am
Arch666Angel wrote: Wed Mar 15, 2017 1:32 pm It should be a slider for the wavelenght of the photons.
definetly this.
That necro is close to obscene :D
User avatar
mexmer
Filter Inserter
Filter Inserter
Posts: 870
Joined: Wed Aug 03, 2016 2:00 pm
Contact:

Re: Train Colors in HSV

Post by mexmer »

Arch666Angel wrote: Thu Mar 21, 2019 7:20 pm
mexmer wrote: Thu Mar 21, 2019 11:57 am
Arch666Angel wrote: Wed Mar 15, 2017 1:32 pm It should be a slider for the wavelenght of the photons.
definetly this.
That necro is close to obscene :D
well, someone resuscited this thread, so i picked answer i like. :mrgreen:

look at dates above my post.
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3234
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Train Colors in HSV

Post by BlueTemplar »

merged
BobDiggity (mod-scenario-pack)
Post Reply

Return to “Ideas and Suggestions”