How change/get non-standard background color for icon

Place to get help with not working mods / modding interface.
Post Reply
hreintke
Fast Inserter
Fast Inserter
Posts: 115
Joined: Mon Sep 04, 2017 6:52 pm
Contact:

How change/get non-standard background color for icon

Post by hreintke »

Hi,

I'd like to create recipe icons which have a different background than the default grey.

When I use the tint option, the icon itself get updated color.
Searching I found the color option but that seems not to have effect.

Code: Select all

icons = {
       	   {
		icon = "__base__/graphics/icons/fluid/crude-oil.png",
		icon_size = 32,
		tint = {b = 0,g = 0,r = 1,a = 0.1},
		color = {b = 1,g = 0, r = 1}
	  }	
	 },
Does anyone have a working example or a link to correct documentation ?

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: How change/get non-standard background color for icon

Post by Klonan »

hreintke wrote:
Sun Sep 23, 2018 12:48 pm
Hi,

I'd like to create recipe icons which have a different background than the default grey.

When I use the tint option, the icon itself get updated color.
Searching I found the color option but that seems not to have effect.

Code: Select all

icons = {
       	   {
		icon = "__base__/graphics/icons/fluid/crude-oil.png",
		icon_size = 32,
		tint = {b = 0,g = 0,r = 1,a = 0.1},
		color = {b = 1,g = 0, r = 1}
	  }	
	 },
Does anyone have a working example or a link to correct documentation ?
The background color is dictated by the GUI they are in, in the recipe icon itself, the background is transparent.

hreintke
Fast Inserter
Fast Inserter
Posts: 115
Joined: Mon Sep 04, 2017 6:52 pm
Contact:

Re: How change/get non-standard background color for icon

Post by hreintke »

OK, clear.

Thanks for the info.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: How change/get non-standard background color for icon

Post by darkfrei »

Klonan wrote:
Sun Sep 23, 2018 12:54 pm
The background color is dictated by the GUI they are in, in the recipe icon itself, the background is transparent.
Why I need icon_size in the item.icon_size, when I haven't icon, but icons?

For example it doesn't work:

Code: Select all

item.icons[1].icon = "__base__/graphics/icons/fluid/barreling/empty-barrel.png" 
item.icons[1].icon_size = 32 
item.icons[2].icon = "__base__/graphics/icons/fluid/barreling/barrel-side-mask.png" 
item.icons[2].icon_size = 32 
But this works:

Code: Select all

item.icon_size = 32
item.icons[1].icon = "__base__/graphics/icons/fluid/barreling/empty-barrel.png" 
item.icons[2].icon = "__base__/graphics/icons/fluid/barreling/barrel-side-mask.png" 
Why icon_size has no deal with icons?

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: How change/get non-standard background color for icon

Post by eradicator »

darkfrei wrote:
Tue Sep 25, 2018 7:32 pm
Why icon_size has no deal with icons?
Because the engine doesn't support icon layers with different sizes?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding help”