Color Converter ? ? ?

Your forum for all discussions around Modding.
User avatar
HC1Gunner
Posts: 451
Joined: Tue Nov 07, 2017 4:19 am

Color Converter ? ? ?

Post by HC1Gunner »

Can someone please point me to a "working" color converter that can convert RGB to whatever format Giant uses?
Asus ROG STRIX X670E-A GAMING
AMD Ryzen 9 7900X3D
32GB G.SKILL Trident Z5 Neo AMD EXPO 32GB DDR5 6000 F5-6000J3038F16GX2-TZ5NR
SSD NVMe 1 TB - Samsung 990 PRO
Sapphire NITRO+ RX 7900 XTX Vapor-X
Corsair HX1200 1200 Watt Pwr Sup
NZXT Kraken Z73 360 AIO CPU Cooler
Sennheiser Game One headset / Sennheiser GSX 1000 Gaming Audio Amplifier
LG 32GK850G-B 32" QHD 65Hz Refresh Rate
Win 11 Pro 64bit
Lorenzos
Posts: 10
Joined: Tue Nov 15, 2016 8:11 pm

Re: Color Converter ? ? ?

Post by Lorenzos »

Giants 'system' use the ratio 1:255. So you just need to divide the classic RGB value by 255.
For example RGB (255, 120, 50) will be approximately 1, 0.47, 0.19
anthu
Posts: 4961
Joined: Thu Nov 06, 2014 8:03 am

Re: Color Converter ? ? ?

Post by anthu »

Last edited by anthu on Thu Oct 03, 2019 9:39 pm, edited 1 time in total.
User avatar
HC1Gunner
Posts: 451
Joined: Tue Nov 07, 2017 4:19 am

Re: Color Converter ? ? ?

Post by HC1Gunner »

Roger, TY

It looks like most numbers stop at (7) places to the right of the decimal, so I'm guessing I can cut my converted number off there?
Asus ROG STRIX X670E-A GAMING
AMD Ryzen 9 7900X3D
32GB G.SKILL Trident Z5 Neo AMD EXPO 32GB DDR5 6000 F5-6000J3038F16GX2-TZ5NR
SSD NVMe 1 TB - Samsung 990 PRO
Sapphire NITRO+ RX 7900 XTX Vapor-X
Corsair HX1200 1200 Watt Pwr Sup
NZXT Kraken Z73 360 AIO CPU Cooler
Sennheiser Game One headset / Sennheiser GSX 1000 Gaming Audio Amplifier
LG 32GK850G-B 32" QHD 65Hz Refresh Rate
Win 11 Pro 64bit
User avatar
asyvan
Posts: 549
Joined: Sun Aug 28, 2016 12:21 am
Location: Sweden

Re: Color Converter ? ? ?

Post by asyvan »

I made this small tool a while ago and posted on my page. Links below.

Color Code Converter
https://docs.google.com/spreadsheets/d/ ... sp=sharing


My page: https://www.facebook.com/je.modding
//Jens Ejvinsson
Farming History: FS11, FS13, FS15, FS17, FS19 (Steam)
Logitech G29, Logitech/Saitek Sidepanel, Logitech F710 Wireless gamepad
PC Gamer - "The Silent Beast" i7-7700K @ 5Ghz, GTX 1070 @ 2.1GHz

Case IH Puma CVX With Tracks
Väderstad Rapid A600-800S Seed Drill
Tutorial compilation for FS19 - list of all my How To guides
User avatar
da-hoffi
Posts: 519
Joined: Fri Aug 15, 2014 8:47 am
Contact:

Re: Color Converter ? ? ?

Post by da-hoffi »

Lorenzos wrote: Thu Oct 03, 2019 9:06 pm Giants 'system' use the ratio 1:255. So you just need to divide the classic RGB value by 255.
For example RGB (255, 120, 50) will be approximately 1, 0.47, 0.19
This may worked for FS15 and maybe 17 too but is not fully correct

value / 255 is correct but then you have to (power) ^2.2 it again
User avatar
asyvan
Posts: 549
Joined: Sun Aug 28, 2016 12:21 am
Location: Sweden

Re: Color Converter ? ? ?

Post by asyvan »

da-hoffi wrote: Mon Oct 07, 2019 12:49 pm
Lorenzos wrote: Thu Oct 03, 2019 9:06 pm Giants 'system' use the ratio 1:255. So you just need to divide the classic RGB value by 255.
For example RGB (255, 120, 50) will be approximately 1, 0.47, 0.19
This may worked for FS15 and maybe 17 too but is not fully correct

value / 255 is correct but then you have to (power) ^2.2 it again
Thanks,
I checked against paint.net and indeed you need to ^2.2 or ^(1/2.2) depending on which way you convert.
I changed my color converter to reflect this.
//Jens Ejvinsson
Farming History: FS11, FS13, FS15, FS17, FS19 (Steam)
Logitech G29, Logitech/Saitek Sidepanel, Logitech F710 Wireless gamepad
PC Gamer - "The Silent Beast" i7-7700K @ 5Ghz, GTX 1070 @ 2.1GHz

Case IH Puma CVX With Tracks
Väderstad Rapid A600-800S Seed Drill
Tutorial compilation for FS19 - list of all my How To guides
Stegei
GIANTS Software | CTO
Posts: 1787
Joined: Sat Jun 09, 2007 10:51 am

Re: Color Converter ? ? ?

Post by Stegei »

The values we use in the xmls, are usually Linear sRGB values. However, the values you are probably used to work with, like they are shown in Photoshop or other editing software, are regular (Non-Linear) sRGB.
So you will have to covert between the two values. Using ^1/2.2 is a okish approximation, but is not the exact formula. The exact conversion from sRGB to linear sRGB is:
if srgb < 0.04045
linearSRGB = srgb / 12.92
else
linearSRGB = ((srgb + 0.055) / 1.055) ^ 2.4
User avatar
asyvan
Posts: 549
Joined: Sun Aug 28, 2016 12:21 am
Location: Sweden

Re: Color Converter ? ? ?

Post by asyvan »

Thanks.
I will change to this. Fantastic.
//Jens Ejvinsson
Farming History: FS11, FS13, FS15, FS17, FS19 (Steam)
Logitech G29, Logitech/Saitek Sidepanel, Logitech F710 Wireless gamepad
PC Gamer - "The Silent Beast" i7-7700K @ 5Ghz, GTX 1070 @ 2.1GHz

Case IH Puma CVX With Tracks
Väderstad Rapid A600-800S Seed Drill
Tutorial compilation for FS19 - list of all my How To guides
User avatar
asyvan
Posts: 549
Joined: Sun Aug 28, 2016 12:21 am
Location: Sweden

Re: Color Converter ? ? ?

Post by asyvan »

asyvan wrote: Mon Oct 07, 2019 5:35 pm Thanks.
I will change to this. Fantastic.
Here is the link again, now corrected with the formula provided by Stegei.
https://docs.google.com/spreadsheets/d/ ... sp=sharing
//Jens Ejvinsson
Farming History: FS11, FS13, FS15, FS17, FS19 (Steam)
Logitech G29, Logitech/Saitek Sidepanel, Logitech F710 Wireless gamepad
PC Gamer - "The Silent Beast" i7-7700K @ 5Ghz, GTX 1070 @ 2.1GHz

Case IH Puma CVX With Tracks
Väderstad Rapid A600-800S Seed Drill
Tutorial compilation for FS19 - list of all my How To guides
User avatar
MAtr1x
Posts: 1
Joined: Wed May 11, 2022 6:01 pm

Re: Color Converter ? ? ?

Post by MAtr1x »

This is the function i use


Private Function ConvertToGiantsSystem(ByVal value As Integer) As Double
' Convert the RGB value to the linear sRGB value
Dim srgb As Double = value / 255
Dim linearSRGB As Double

If srgb < 0.04045 Then
linearSRGB = srgb / 12.92
Else
linearSRGB = Math.Pow((srgb + 0.055) / 1.055, 2.4)
End If

' Return the Giants system value
Return linearSRGB
End Function

https://www.dropbox.com/s/0e5mzt1ywad1o ... r.png?dl=0

the picture in the link above works but adding thing to it still
Post Reply