Mod Details

Color Converter API

Color Converter API 1.1.1

Created by  RaiRaiTheRaichu

39.0K Downloads

SPT 3.11.4 Compatible

Client-side mod to allow using hexcode colors for your items! Custom background colors for your items, or any color tracer you want!

Latest Version 1.1.1
SPT 3.11.4

Updated Aug 13, 2024 at 11:31 PM

Version Notes

Changelog:

Fixed case-sensitive string parsing for color enum.

(Error “Failed to read JSON value for TaxonomyColor” for certain mods.)

Hey! Thanks for downloading, if you’d like to support my work, you’re more than welcome to support me at the link below or follow along at my Ko-Fi page here:

https://ko-fi.com/rairaitheraichu

This download is externally hosted.
Always scan for viruses.
Mod Info

Color Converter API

Find out more about what EFT mods I’m working on here!

https://trello.com/b/CONaHPTn/…i-mods-by-rairaitheraichu

An SPT module mod that extends the functionality of the client, allowing the server to use raw hexcode color values for fields that ordinarily can only support BSG-created color enums.

This mod should be forward-compatible with all new client releases for EFT (unless something very, very significant changes) and does NOT need to be updated.

Please note that on its own, this mod does nothing! It allows OTHER mods to use the full color spectrum where BSG uses the predefined color enums.

How to install

  1. Simply extract the zip file contents into your root SPT-AKI folder (where EscapeFromTarkov.exe is).
  2. Your BepInEx/plugins folder should now contain a RaiRai.ColorConverterAPI.dll file inside.

License

Do not reupload or redistribute anywhere without explicit permission - please instead link to this mod page as part of your dependencies.

Usage (for modders)

You can check to see if the plugin exists in your server mod’s source code any way you’d like, but an easy copy-paste check is here:

private static IsPluginLoaded(): boolean { const fs = require(‘fs’); const pluginName = “rairai.colorconverterapi.dll”; // Fails if there’s no ./BepInEx/plugins/ folder try { const pluginList = fs.readdirSync(“./BepInEx/plugins“).map(plugin => plugin.toLowerCase()); return pluginList.includes(pluginName); } catch { return false; } } You can handle the result of this function however you’d like. Once you have validated that the plugin exists, you can proceed to fill in the fields for color in your item database with hexcodes in lieu of a color enum.

For example:

“TracerColor”: “#FF00FF”,

“BackgroundColor”: “#2A2AFF”,

Short 3-byte hexcode colors are also supported like so:

“BackgroundColor”: “#F90”,

Which will be interpreted as:

“BackgroundColor”: “#FF9900”,

As of version 1.1.0, you can optionally pass a fourth hex value for an Alpha (otherwise, it is treated as FF/255).

“BackgroundColor”: “#FF2AFF99”,

Changelog
  • July 10th, 2024:
    • Refactor to module changes for SPT 3.9.0+.
    • Added support for alpha values for hex codes.
Version 1.1.1
Download Mod Version
SPT 3.11.4
Latest Compatible SPT Version

23.9K Downloads

Created Aug 13, 2024 at 11:31 PM

Updated Aug 13, 2024 at 11:31 PM

Virus Total Results

Changelog:

Fixed case-sensitive string parsing for color enum.

(Error “Failed to read JSON value for TaxonomyColor” for certain mods.)

Hey! Thanks for downloading, if you’d like to support my work, you’re more than welcome to support me at the link below or follow along at my Ko-Fi page here:

https://ko-fi.com/rairaitheraichu

Version 1.1.0
Download Mod Version
SPT 3.9.0
Latest Compatible SPT Version

2.8K Downloads

Created Jul 10, 2024 at 8:44 PM

Updated Jul 10, 2024 at 8:44 PM

Virus Total Results

Changelog:

Refactor to module changes for SPT 3.9.0+.

Added support for alpha values for hex codes.

Hey! Thanks for downloading, if you’d like to support my work, you’re more than welcome to support me at the link below or follow along at my Ko-Fi page here:

https://ko-fi.com/rairaitheraichu

Version 1.0.0
Download Mod Version
Unknown SPT Version
Latest Compatible SPT Version

12.4K Downloads

Created Oct 9, 2023 at 1:48 AM

Updated Oct 9, 2023 at 1:48 AM

Virus Total Results

(Reupload due to broken permissions.)

Link not working? Try downloading from here:

https://github.com/RaiRaiTheRaichu/ColorConverterAPI/releases

https://dev.sp-tarkov.com/RaiRaiTheRaichu/ColorConverterAPI/releases

RaiRaiTheRaichu
Administrator
Pinned

Updated the mod page, I have tested this and it still functions perfectly fine on 3.10.x.

Edit: Also works on 3.11.x

0 Likes
FiveF

For 4.0 seems work fine. At least for server side mod.

0 Likes
Dante406

Do i put this mod in the client or server install if i want to use headless

0 Likes

it’s a client DLL, and the headless client will probably throw an error when it’s sent data from the server without having this installed if you have a mod requiring it.

0 Likes

Thx for the reply

0 Likes
FiveF

For 3.11 seems work fine.

1 Like

useful comment

0 Likes

thank you for confirming

0 Likes
TimmyGG

EDIT: I stand corrected - It does, in fact work on 3.10.x

-----------------------------------------------------------------------------------------

Unfortunately, doesn’t work with 3.10 - which was expected. I attempted to look over the code but, no knowledge of C#. lol - Thank you for your work RaiRai!

1 Like
S.Michailow

i get this with 3.9.2

Screenshot-2024-07-17-080539.png

0 Likes

i’ve never been able to reproduce this error. what is your mod list? can you send all of your logs?

EDIT: fixed in v1.1.1.

0 Likes
Nile

I also got this error this morning after installing 3 new mods, SVM, Acog4Life Optic Rework, and WTT - Rogue Justice. I deleted Rogue Justice and the error went away. 3.9.1

0 Likes

MODS:

AAAArtemTrader

AAArtemEquipment

acidphantasm-bosseshavelegamedals

acidphantasm-brightlasers

acidphantasm-harryhideout

acidphantasm-refsptfriendlyquests

aMoxoPixel-Painter

ATLAS-GEAR

AUG_AttachmentPack

bakahashi-pityloot

BARF

BarlogM-Andern

choccy-93raffica-1.1.5

choccy-saa-1.0.6

choccy-uzi-1.2.5

ChooChoo-TraderModding

cj-removetimegatefromquests

DrakiaXYZ-LiveFleaPrices

ExpandedTaskText

house-legsthetrader-1.1.0

IhanaMies-LootValueBackend

Jehree-GildedKeyStorage

JoshMate-BetterBackpacks-reloaded

krackasourus-animeCards

krackasourus-cardCase

krackasourus-pokemonCards

Load Order Editor.exe

maxloo2-betterkeys-updated

MoreCheckmarksBackend

MoxoPixel-ASS

MoxoPixel-BlackCore

MoxoPixel-MagTape

MoxoPixel-TacticalGearComponent

MusicManiac-LessRestrictingHeadwear

odt-iteminfo

pes7-sashahimik-0.6.1

PreyToLive-DynamicWeatherAndSeasons

ProfileEditorHelper

raid_review__0.1.1_NEXT

refringe-customraidtimes

revingly-micc

RexMUT

ServerValueModifier

SIG_MCX_VIRTUS

Skwizzy-LootingBots-ServerMod

SpecialSlots

SWAG

TheGambler

tomanw-realisticpmcweapons

tomanw-removeblacklist

torturedchunk-levelrewards

tyfon-uifixes

Virtual’s Custom Quest Loader

WTT-Armory-Ak5C

WTT-Armory-Arisaka

WTT-Armory-Cheytac

WTT-Armory-CZ75

WTT-Armory-HK417

WTT-Armory-RexTacWoS

WTT-Armory-SVD

WTT-Armory-WilsonCombat

WTT-LittleDrummerBoy

WTT-PackNStrap

WTT-RexProdigy

WTT-RogueJustice

WTT-SianydeAndACRiness

WTT-SianydeAndG3iness

WTT-SianydeAndScorpiness

zPreyToLive-CustomLauncherBackgrounds

zSolarint-SAIN-ServerMod

zz_guiltyman-addmissingquestweaponrequirements

z_hacker228-peacekeepersm855a1ammos

PLUGINS:

acidphantasm-moretagcolours.dll

AmandsGraphics.dll

Arys-CustomAssetImporter

CactusPie.RamCleanerInterval.dll

ChooChoo-TraderModding.dll

DrakiaXYZ-BigBrain.dll

DrakiaXYZ-QuickMoveToContainer.dll

DrakiaXYZ-SearchOpenContainers.dll

DrakiaXYZ-TaskListFixes.dll

DrakiaXYZ-Waypoints

dvize.Donuts

dvize.GTFO

DynamicMaps

Endurance.dll

HideSpecialIcon.dll

HideTopGlow.dll

IcyClawz.CustomInteractions.dll

IcyClawz.ItemAttributeFix.dll

IcyClawz.ItemContextMenuExt.dll

IcyClawz.ItemSellPrice.dll

IcyClawz.MagazineInspector.dll

IcyClawz.MunitionsExpert.dll

Kaeno-TraderScrolling.dll

kmyuhkyuk-EFTApi

kvan-RaidSkillInfo.dll

LootValue

MoreCheckmarks

OpenTheDamnContextMenu_3.9.0.dll

PlayerEncumbranceBar

RAID_REVIEW__0.1.1.dll

RaiRai.HiddenCaches.dll

SAIN

Seion.Iof.dll

skwizzy.LootingBots.dll

Solarint-HeadshotDamageRedirect.dll

Solarint-LouderSuppressors.dll

SpecialSlots.dll

StashSearch

ThatsLit

TraderServicesFix

Tyfon.UIFixes.dll

UnityToolkit

UseItemsFromAnywhere.dll

utjan.HoF-Improved

utjan.PlantTimeModifier

VCQLQuestZones.dll

WTT-PackNStrap

WTT-PackNStrap.dll

WTT-RogueJustice

WTT-VoicePatcher

WTT-VoicePatcher.dll

Everything works fine just with the ColorConverterAPI.dll in Plugins i get the Error.

EDIT: Like the User Nile said, i also add the “WTT-Rogue Justice” this morning, maybe it has to do with it or the upgrade to 3.9.2.

0 Likes

interesting.

i can’t test it right now, but i have a suggestion.

for now, it takes a little manual editing, but maybe i can patch something on my end for a v1.1.1.

go into your user/mods/WTT-RogueJustice/db/ folder, and open each of the 8 json files.

do a batch replace (control+H in notepad++, for example) and set it to replace Black with black. check the box for “Match case” and hit replace all. then save. do this for each json, and then try it again.

go4sHxL.png

2 Likes

Thanks for the suggestion but I think I’d better wait for a possible update from you because I don’t know if I’ll break the “Rogue Justice” with it. but no hurry, it’s not that important.

0 Likes
asaguda

Can confirm it works.

There’s a few occurences of “BackgroundColor”: “Black”, in several of those files.

After changing them to “BackgroundColor”: “black”, it now loads correctly.

0 Likes

it’s worked….

0 Likes

thank you for confirming it works.

i’m kind of surprised about this, but it’s an easy enough fix to sanitize names for when authors decide to use random capital letters in their colors. i’ll release an update soon.

1 Like

Confirmed fixed as of v1.1.1.

1 Like
Refringe
Administrator

Fantastic work! ♥

0 Likes
Demigods

Soo this might be the dumbest question ever but how does the mod work? I hit F12 and couldn’t find it in the list to recolor items.

0 Likes
FiveF

this mod is for modders. allows for custom background colors or racers or others colors. basic eft allows 7-9 different colors.

0 Likes
Demigods

damn I wish i knew how to use it. I would love my own backgrounds for items and weapons and gear and stuff… I had one from DJLand in last version before 3.8.0 hit but i havent seen it since.

0 Likes
FiveF

its simple. just edit database. Instead using blue, default, yellow, red, black, tracerRed etc, you can use hex values (i.e. 16 bits xd)

eg

//ammo background 2.1 for (const itemID in itemsData) { const item = itemsData[itemID]; if (item._parent === 5485a8684bdc2da71d8b4567) { if (item._props.PenetrationPower <= 5) { item._props.BackgroundColor = #010000; //1 } else if (item._props.PenetrationPower <= 10) { item._props.BackgroundColor = #030000; //3 } else if (item._props.PenetrationPower <= 15) { item._props.BackgroundColor = #060000; //6 } else if (item._props.PenetrationPower <= 20) { item._props.BackgroundColor = #0a0000; //10 } else if (item._props.PenetrationPower <= 25) { item._props.BackgroundColor = #100000; //16 } else if (item._props.PenetrationPower <= 30) { item._props.BackgroundColor = #170000; //23 } else if (item._props.PenetrationPower <= 35) { item._props.BackgroundColor = #1f0000; //31 } else if (item._props.PenetrationPower <= 40) { item._props.BackgroundColor = #290000; //41 } else if (item._props.PenetrationPower <= 45) { item._props.BackgroundColor = #340000; //52 } else if (item._props.PenetrationPower <= 50) { item._props.BackgroundColor = #400000; //64 } else if (item._props.PenetrationPower <= 55) { item._props.BackgroundColor = #4d0000; //77 } else if (item._props.PenetrationPower <= 60) { item._props.BackgroundColor = #5c0000; //92 } else if (item._props.PenetrationPower <= 65) { item._props.BackgroundColor = #6c0000; //108 } else if (item._props.PenetrationPower <= 70) { item._props.BackgroundColor = #7d0000; //125 } else if (item._props.PenetrationPower <= 75) { item._props.BackgroundColor = #8f0000; //143 } else if (item._props.PenetrationPower <= 80) { item._props.BackgroundColor = #a30000; //163 } else if (item._props.PenetrationPower <= 85) { item._props.BackgroundColor = #b80000; //184 } else if (item._props.PenetrationPower <= 90) { item._props.BackgroundColor = #cf0000; //207 } else if (item._props.PenetrationPower <= 95) { item._props.BackgroundColor = #e60000; //230 } else { item._props.BackgroundColor = #ff0000; //255 } } This is was part of my old of manually written logarithmic penetration coefficient for ammunition (for RM). Look on #030000, #4d0000 etc. You can paste it here and see what color it is (this is blackRed to whiteRed).

I currently use two colors divided into calibers to determine if penetration is good or best for current caliber.

export function backgroundAmmos(databaseServer: any) { const itemsData = databaseServer.tableData.templates.items; const enData = databaseServer.tableData.locales.global.en; //ammo background 3.0? const ammoList12x70: any[] = []; const ammoList20x70: any[] = []; const ammoList23x75: any[] = []; const ammoList26x75: any[] = []; const ammoList9x18: any[] = []; const ammoList762x25: any[] = []; const ammoList9x19: any[] = []; const ammoList1143x23: any[] = []; const ammoList9x21: any[] = []; const ammoList57x28: any[] = []; const ammoList46x30: any[] = []; const ammoList9x39: any[] = []; const ammoList9x33: any[] = []; const ammoList366_TKM: any[] = []; const ammoList545x39: any[] = []; const ammoList556x45: any[] = []; const ammoList68x51: any[] = []; const ammoList762x39: any[] = []; const ammoList762x35: any[] = []; const ammoList762x51: any[] = []; const ammoList762x54: any[] = []; const ammoList127x55: any[] = []; const ammoList86x70: any[] = []; const ammoList127x108: any[] = []; const ammoList40x46: any[] = []; const ammoListOthers: any[] = []; for (const itemId in itemsData) { const item = itemsData[itemId]; if (item._parent === 5485a8684bdc2da71d8b4567) { const keyInEnData = ${itemId} Name; if (enData[keyInEnData]) { let addedToSpecificList = false; const ammoList = getAmmoList(enData[keyInEnData]); if (ammoList) { ammoList.push({ _id: item._id, name: enData[keyInEnData], PenetrationPower: item._props.PenetrationPower, Damage: item._props.Damage, ArmorDamage: item._props.ArmorDamage }); addedToSpecificList = true; } if (!addedToSpecificList) { ammoListOthers.push({ _id: item._id, name: enData[keyInEnData], PenetrationPower: item._props.PenetrationPower, Damage: item._props.Damage, ArmorDamage: item._props.ArmorDamage }); } } } } function getAmmoList(ammoName) { switch (true) { case ammoName.startsWith(12/70): return ammoList12x70; case ammoName.startsWith(20/70): return ammoList20x70; case ammoName.startsWith(23x75mm): return ammoList23x75; case ammoName.startsWith(26x75mm): return ammoList26x75; case ammoName.startsWith(9x18mm): return ammoList9x18; case ammoName.startsWith(7.62x25mm): return ammoList762x25; case ammoName.startsWith(9x19mm): return ammoList9x19; case ammoName.startsWith(.45 ACP): return ammoList1143x23; case ammoName.startsWith(9x21mm): return ammoList9x21; case ammoName.startsWith(5.7x28mm): return ammoList57x28; case ammoName.startsWith(4.6x30mm): return ammoList46x30; case ammoName.startsWith(9x39mm): return ammoList9x39; case ammoName.startsWith(.357 Magnum): return ammoList9x33; case ammoName.startsWith(.366 TKM): return ammoList366_TKM; case ammoName.startsWith(5.45x39mm): return ammoList545x39; case ammoName.startsWith(5.56x45mm): return ammoList556x45; case ammoName.startsWith(6.8x51mm): return ammoList68x51; case ammoName.startsWith(7.62x39mm): return ammoList762x39; case ammoName.startsWith(.300): return ammoList762x35; case ammoName.startsWith(7.62x51mm): return ammoList762x51; case ammoName.startsWith(7.62x54mm R): return ammoList762x54; case ammoName.startsWith(12.7x55mm): return ammoList127x55; case ammoName.startsWith(.338 Lapua Magnum): return ammoList86x70; case ammoName.startsWith(12.7x108mm): return ammoList127x108; case ammoName.startsWith(40x46mm): return ammoList40x46; default: return ammoListOthers; } } function updateBackgroundColor(ammoList, itemsData) { var penetrationPowers = ammoList.map(ammo => ammo.PenetrationPower); var maxPenetrationPower = Math.max(…penetrationPowers); //loop each ammo and update BackgroundColor based on PenetrationPower ammoList.forEach(ammo => { if (ammo.PenetrationPower >= maxPenetrationPower - (maxPenetrationPower * 0.075)) { itemsData[ammo._id]._props.BackgroundColor = “#ff0000”; } else if (ammo.PenetrationPower >= maxPenetrationPower - (maxPenetrationPower * 0.2)) { itemsData[ammo._id]._props.BackgroundColor = “#800000”; } }); } updateBackgroundColor(ammoList12x70, itemsData); updateBackgroundColor(ammoList20x70, itemsData); updateBackgroundColor(ammoList23x75, itemsData); updateBackgroundColor(ammoList26x75, itemsData); updateBackgroundColor(ammoList9x18, itemsData); updateBackgroundColor(ammoList762x25, itemsData); updateBackgroundColor(ammoList9x19, itemsData); updateBackgroundColor(ammoList1143x23, itemsData); updateBackgroundColor(ammoList9x21, itemsData); updateBackgroundColor(ammoList57x28, itemsData); updateBackgroundColor(ammoList46x30, itemsData); updateBackgroundColor(ammoList9x39, itemsData); updateBackgroundColor(ammoList9x33, itemsData); updateBackgroundColor(ammoList366_TKM, itemsData); updateBackgroundColor(ammoList545x39, itemsData); updateBackgroundColor(ammoList556x45, itemsData); updateBackgroundColor(ammoList68x51, itemsData); updateBackgroundColor(ammoList762x39, itemsData); updateBackgroundColor(ammoList762x35, itemsData); updateBackgroundColor(ammoList762x51, itemsData); updateBackgroundColor(ammoList762x54, itemsData); updateBackgroundColor(ammoList127x55, itemsData); updateBackgroundColor(ammoList86x70, itemsData); updateBackgroundColor(ammoList127x108, itemsData); updateBackgroundColor(ammoList40x46, itemsData); updateBackgroundColor(ammoListOthers, itemsData); } ;p

yes i am too fasst

0 Likes
Demigods

lol I did NOT understand any of what you do said.. All i see are letters and numbers. To bad there wasn’t a hud to make your own background colors using a hud program for dumb people like me lol

0 Likes
SezaRoski
0 Likes

I have posted a help threads about it

0 Likes
Houragorn

This might be foolish of me but, would there be a way to use this to add more colours to the “Tag” feature for containers? Is that even possible?

0 Likes

It would take a separate client mod, but an RGB slider or something definitely wouldn’t be impossible.

IIRC, that kind of information gets saved to the profile so I’d be concerned that if you removed the mod, your profile would be broken unless you untagged/deleted the items.

Still, it’s definitely doable.

0 Likes
Houragorn

Thanks for the response King. As I feared it will be more than what my little coding skills can do. I might try but most likely will hit a wall. Thanks none the less for the pointers!

0 Likes

Details