[Mod] Unified Dyes [20170620][unifieddyes]

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

[Mod] Unified Dyes [20170620][unifieddyes]

by VanessaE » Post

Unified Dyes

The purpose of this mod originally was to supply a complete set of colors for Minetest mod authors to use for colorized nodes, or to reference in. recipes. Since the advent of the default dyes mod in minetest_game, this mod has become more of an extension of the default mod and a library for general color handling.

Unified Dyes expands the standard dye set from 15 colors to 32, 197, or 256 (see below).

Dependencies: Minetest engine version 5.1.0 or higher and a corresponding copy of minetest_game.

Recommends: default flowers mod.

License: GPL 2.0 or higher.

Download: https://github.com/mt-mods/unifieddyes/ ... master.zip
...or browse the code: https://github.com/mt-mods/unifieddyes

Install: Unzip the distribution file, rename the resultant folder to just "unifieddyes", move it into Minetest's mods folder, and enable it in your world configuration.

API:
The full Unified Dyes API is documented here: https://github.com/mt-mods/unifieddyes/ ... ter/API.md

Used By:
Spoiler
The Palettes:
Spoiler
In these images, the "-50%" markings on the left next to some shades mean 50% saturation for all hues in that shade line. Note that the shades above "full" don't have (or need) this variation, since they're already lower-saturation by having been generated by brightening the full colors. For the greys, the percentages shown are of brightness relative to pure white. In these palettes, there are a few special cases: pink is aliased to light red, brown is aliased to medium orange, and the recipe for dark orange differs from the standard formula. I got the names for the more esoteric colors from this site: http://www.procato.com/rgb+index/

Image
This is the official "extended" palette, showing 240 colors, arranged as 24 hues with 10 brightness/saturation combinations for each, plus 16 greys. For an example of how this palette is used, see Stained Glass mod. If you happen to examine the palette file, you'll notice several bright green pixels in one corner, so-colored to remind me (or you) that these are unused pixels that will be discarded by the engine. If you notice a warning about this palette not having exactly 256 pixels, ignore it.

Image
This is the 197-color palette, which is actually supplied as a set of "cut up" palette images: each of the 24 hues above has its own file, with each file containing 8 shades of that hue, plus one more containing the 5 levels of greyscale. These palettes are used when you need the "colorfacedir" mode, especially when you need to define a whole bunch of alternate shapes from your base node. You define a single base node, as usual, then 25 copies of each of your alternate shapes, one suitably-named copy per hue (there's a helper function for this, by the way). Take a look at my Colored Wood mod for examples of how this is done (you can also see examples of the "extended" palette in that mod).

Image
This is the "colorwallmounted" palette, which contains an abridged version of the above palette, since the engine only allows 32 color slots with that mode. This palette contains eight of the standard hues, three shades each (full, medium, dark), plus the standard 5-shades of greyscale, along with light blue, light green, and pink. Take a look at my Industrial Lights mod for an example of how this palette is used.
Usage Guide
Spoiler
Getting Started

The short version:
  1. Get some flowers, cactus, or coal.
  2. Make some dye, maybe mix some of those dyes together to get more colors.
  3. Place a neutral-colored block on the ground.
  4. Use the airbrush on the block to change its color.
  5. Or, just craft and place the colored block directly.
The long version:

First thing's first: you're going to need to harvest some materials to make the dyes from. For this, you need one or more of the following: roses (red), tulips (orange), yellow dandelions (yellow), cactus (green), geraniums (blue), violas (purple), coal (black), or white dandelions (white). Simply wander around your world and collect whichever of the above you need to get your colors.

Image

Simply place one of the above materials into the crafting grid to obtain four portions of dye in that color. From those 8 "base" colors, you can directly fashion the rest. In some cases, you can also craft one or more interim colors and then use those to craft the main colors, as outlined below (for example, you can make azure with two blue and one green, or one cyan and one blue).

Image

Here you can see the 24 standard hues and 16 levels of greyscale. All of the colors were created by directly crafting the 6 "base" hues, while black and white were used to create some greys, then those were combined together or with more black and/or white to create the rest of the greys. These crafting recipes are all "shapeless" (i.e. it doesn't matter how you arrange the dyes), and all of them yield 2 unless otherwise stated. They are as follows:

██     (0°) Red:           1 rose flower (not the dye color, yields 4)
██   (15°) Vermilion:   red + orange
██   (30°) Orange:      1 tulip, or mix red + yellow dye
██   (45°) Amber:         orange + yellow
██   (60°) Yellow:        1 yellow dandelion (yields 4)
██   (75°) Lime:           yellow + chartreuse, or 2 yellow + 1 green (yields 3)
██   (90°) Chartreuse: yellow + green
██ (105°) Harlequin:    chartreuse + green, or 1 yellow + 2 green (yields 3)
██ (120°) Green:         1 cactus (yields 4), or mix yellow + blue
██ (135°) Malachite:    green + spring, or 2 green + 1 cyan (yields 3), or 3 green + 1 cyan (yields 4)
██ (150°) Spring:         green + cyan, or 2 green + 1 blue (yields 3)
██ (165°) Turquoise:   spring + cyan, or 1 green + 2 cyan (yields 3), or 3 green + 2 blue (yields 5)
██ (180°) Cyan:          green + blue
██ (195°) Cerulean:    cyan + azure, or 2 cyan + 1 blue (yields 3), or 2 green + 3 blue (yields 5)
██ (210°) Azure:         cyan + blue, or 1 green + 2 blue (yields 3)
██ (235°) Sapphire:    azure + blue, or 1 cyan + 2 blue (yields 3)
██ (240°) Blue:           1 geranium
██ (255°) Indigo:         1 blue + violet
██ (270°) Violet:          1 viola (yields 4), or mix blue + magenta
██ (285°) Mulberry:     violet + magenta, or violet + blue + red (yields 3)
██ (300°) Magenta:     blue + red
██ (315°) Fuchsia:      magenta + rose, or blue + red + rose dye (yields 3), or red + violet
██ (330°) Rose dye:    magenta + red, or 2 red + 1 blue (yields 3)
██ (345°) Crimson:      rose dye + red, or 1 magenta + 2 red (yields 3), or 1 blue + 3 red (yields 4)

██      (0%) Black:                              1 piece of coal (yields 4)
██   (6.7%) Grey #1:                          3 black + 1 dark grey (yields 4)
██ (13.3%) Grey #2:                          2 black + 1 dark grey (yields 3)
██    (20%) Grey #3:                           black + dark grey
██ (26.7%) Grey #4 ("Dark Grey"):     1 white + 2 black (yields 3)
██ (33.3%) Grey #5:                          2 dark grey + 1 grey (yields 3)
██    (40%) Grey #6:                          dark grey + grey
██ (46.7%) Grey #7:                          1 dark grey + 2 grey (yields 3)
██ (53.3%) Grey #8 (just "Grey"):        white + black
██    (60%) Grey #9:                          2 grey + 1 light grey (yields 3)
██ (66.7%) Grey #10:                        1 grey + 2 light grey (yields 3)
██ (73.3%) Grey #11 ("Light Grey"):  2 white + 1 black (yields 3)
██    (80%) Grey #12:                        2 light grey + 1 white (yields 3)
██ (86.7%) Grey #13:                         light grey + white
██ (93.3%) Grey #14:                        1 light grey + 2 white (yields 3)
▏▕  (100%) White:                             1 white dandelion (yields 4)

The list above has one exception: If you have Technic mod installed, it overrides the cactus recipe, making it yield 1 dye. You must use its "extractor" device to get 4.

The degree figures are the colors' hues on a standard HSV color wheel, and are what I used in the textures supplied with this mod. For the greys, the figures in parenthesis indicate the ideal brightness of the shade, relative to white, but note that they're not exactly on target, depending on which palette you're using. In the 32- and 197-color split palettes, black doesn't go all the way to the bottom of the scale, since there just aren't many greyscale levels to work with there, and pure black would crush out all of the details in your textures. The 256-color palette has a pure black shade, but you probably won't want to use it that much.

Darker/Lighter colors, low-saturation variations

To obtain lighter or darker shades, simply mix one or two portions of the hue from the list above with black or white as outlined below.

Faint:       base color + 3 white (yields 4)
Pastel:     base color + 2 white (yields 3)
Light:       base color + 1 white
Bright:      two base color + 1 white (yields 3)
Medium:  base color + 1 black
Dark:        base color + 2 black (yields 3)

The above formula has one exception: because of a conflict with default dyes mod, dark orange must be crafted from two brown dyes (yields 2, of course).

Low saturation:                base color + light grey, or base color + one black + two white (yields 4)
Low saturation, Medium: base color + grey, or base color + one black + one white (yields 3)
Low saturation, Dark:       base color + dark grey, or base color + two black + one white (yields 4)

Applying dye to a node

Now that you have some color, simply use it in a crafting recipe, just like normal (assuming the mod the recipe's for supports that color).

The airbrush

If crafting is not to your taste, there's also the airbrush tool. To make one:

Image
Two steel ingots, one brass ingot, one plastic sheet.

To use it, simply right-click on any random node (colorized or not, colorable or not) to open the color selector:

Image
The color selector, showing highlights around the 15 standard minetest_game dyes that I have in my inventory.

Click on a color to select it, then click "Accept" to commit to that color. Then, just run around, punching nodes with the airbrush to paint or re-paint them (assuming a given node can take on a color, of course).

In survival mode, whatever dye you want to paint with must be somewhere (anywhere) in your inventory, except the crafting grid. Your on-hand dyes will be highlighted in the selector, as shown above, and the selector will limit your choices to just those so-highlighted. The selected dye will be consumed as you use the airbrush to repaint nodes.

In creative mode, no on-hand dyes are necessary. Any color may be selected (the "on hand" markers are not shown). Obviously, there's nothing to run out of in this mode. :-)

The airbrush will warn you if you try to paint unpaintable nodes, if you're out of the dye you wanted to use (in survival mode), if you try to paint a node with a color it can't take, and several other messages.

You can also shift + right-click on a colorized node while wielding the airbrush, and it will attempt to figure out what the name of the color is that's applied to that node, and will switch to that color.

And no, you don't get the old dye back when you change the color of a node. :-P

Misc. Notes

If you need to use /give commands, the item names are simply "dye:color", e.g. "dye:red", "dye:pink", or "dye:yellow". Greys have a similar naming convention: dye:white, dye:light_grey, dye:grey, dye:dark_grey, or dye:black, or "dye:grey_" followed by a number from 1 to 14 (1 being the darkest shade, aside from black).

For everything beyond the initial "full" hues, the item names are of the following format:

dye:[brightness]_[hue]_[saturation]

Where "brightness" can be "faint", "pastel", "light", "bright", nothing at all (e.g. full), medium, or dark. "Hue" is exactly as in the tables and images above, e.g. red, green, yellow, etc. "Saturation" can be either nothing or "s50". Omit trailing and leading underscores.

For example, low saturation dark yellow is "unifieddyes:dark_yellow_s50", while light normal-saturation violet would be "unifieddyes:light_violet".
Attachments
Screenshot_2018-12-13_21-05-23.png
Screenshot_2018-12-13_21-05-23.png (9.02 KiB) Viewed 5902 times
unifieddyes_palette_split.png
unifieddyes_palette_split.png (38 KiB) Viewed 5902 times
Screenshot_2018-08-27_19-46-56.png
Screenshot_2018-08-27_19-46-56.png (319.45 KiB) Viewed 5902 times
unifieddyes-colorwallmounted.png
unifieddyes-colorwallmounted.png (15.05 KiB) Viewed 5902 times
unifieddyes2.png
unifieddyes2.png (17.57 KiB) Viewed 5902 times
unifieddyes1.png
unifieddyes1.png (13.73 KiB) Viewed 5902 times
unified-dyes-extended-palette.png
unified-dyes-extended-palette.png (43.96 KiB) Viewed 5902 times
Last edited by VanessaE on Tue Apr 30, 2013 10:36, edited 1 time in total.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Mallot1
Member
Posts: 85
Joined: Wed Jun 27, 2012 04:38

by Mallot1 » Post

this rocks im downloading it tommorow but what are you mod commands to use it?

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Unified Dyes (made in response to the forum thread of the same name) is designed so that you just smelt (cook) flowers, cactus, or coal, and craft a couple of things to get the various colors.

If you want to use those colors to make something, you must first make something, i.e. a mod, that can use the colors to begin with. The idea is that other mods should be able to use this one to get their colors in a somewhat real-ish manner.
Last edited by VanessaE on Sun Jul 08, 2012 22:32, edited 1 time in total.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

Just saying, cotton will use all of these colours. (And should be co-written by VanessaE)

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

2012-07-16: Added 12 more colors - the "light" shades, which are 150% brightness relative to the regular "full" colors. No low-saturation versions of these (didn't seem like they were needed). Updated the modding template and gentextures scripts to match, and regenerated all of the bottles of dye for consistency.

A bit later: Added a proper palette/swatch image for the first post.
Last edited by VanessaE on Mon Jul 16, 2012 21:41, edited 1 time in total.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

VanessaE wrote:2012-07-16: Added 12 more colors - the "light" shades, which are 150% brightness relative to the regular "full" colors. No low-saturation versions of these (didn't seem like they were needed). Updated the modding template and gentextures scripts to match, and regenerated all of the bottles of dye for consistency.

A bit later: Added a proper palette/swatch image for the first post.
Good mod: no lag.

Template is awesome.

My only complaint is your const. adding colours.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

I'm done adding colors to it. I only need to worry about maintenance at this point. :-)
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
SegFault22
Member
Posts: 872
Joined: Mon May 21, 2012 03:17
Location: NaN

by SegFault22 » Post

can you change the ''smelting'' of glass to get bottles to something else, please? it conflicts with sdzen's building blocks mod (smelting glass makes industrial glass)
"All we need it the right major crisis and the nations will accept the new world order."

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

2012-07-26: Split off glass bottles into a separate mod, "Vessels". This mod now depends on it. Also gave the mod better bottle textures (they still need work though).
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
RealBadAngel
Member
Posts: 557
Joined: Wed Jul 18, 2012 16:30

by RealBadAngel » Post

i need to use dyes in my mod and since last git build im a bit confused.
game now has built-in dye mod. is it yours rewritten?

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

The built-in mod is a fork of the dye system that was part of Jordach's old 16-color wool mod. Unified Dyes is a system which I wrote to try to address the shortcomings of all the other implementations I've seen, and it now related to the built-in one (save for being a dye system in general, of course).

The one that is now part of the game was incorporated after I wrote mine.

Unified Dyes is compatible with the wool that is now part of the game, as well as several downloadable mods. The way mine and the built-in dyes work, mine can be used as an extension of the built-in one.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
RealBadAngel
Member
Posts: 557
Joined: Wed Jul 18, 2012 16:30

by RealBadAngel » Post

Will have to decide which dyes i will b using then.
You said you were lookin for better bottle gfx, maybe this will be good:
http://www.softicons.com/free-icons/too ... flask-icon
or this one:
http://realbadangel.pl/bottle.png
Last edited by RealBadAngel on Sun Jul 29, 2012 19:59, edited 1 time in total.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Thanks for the icons, but they're not quite the style I was going for. I'll figure something out though. :-)
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Figured something out as you might have noticed. :-)
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
RealBadAngel
Member
Posts: 557
Joined: Wed Jul 18, 2012 16:30

by RealBadAngel » Post

doin right now electric furnace and encountered a bug in default furnace, it affects also your mod
when the item is cooked it checks for aviable place to move it to furnace's inventory
right, but it wasnt made to check to move 10 items at the time.
so cookin stone and having 10 dioxide each, will hang the game when filled up inventory.
Last edited by RealBadAngel on Fri Aug 03, 2012 20:29, edited 1 time in total.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Interesting.

Until the furnace gets full, it seems to work fine for me in 0.4.2-rc1; the furnace turns each stone into 10 titanium dioxide, and they see, to stack up to a max of 99 per output slot just as you'd expect them to.

When the furnace gets full, it actually causes the game to segfault for me, and then basically makes the world unusable after that.

Can't do anything about that unfortunately, it's a bug in the game.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
RealBadAngel
Member
Posts: 557
Joined: Wed Jul 18, 2012 16:30

by RealBadAngel » Post

only removing overloaded furnace with external world edit could help
dunno if theres such application for minetest tho
if not, imagine some1 cookin whole stack of stone on a developed server...
folks could be lets say pissed off ;)

User avatar
Menche
Member
Posts: 1001
Joined: Sat Jul 02, 2011 00:43
IRC: Menchers
In-game: Menche
Location: An island in a lava lake.

by Menche » Post

VanessaE wrote:Interesting.

Until the furnace gets full, it seems to work fine for me in 0.4.2-rc1; the furnace turns each stone into 10 titanium dioxide, and they see, to stack up to a max of 99 per output slot just as you'd expect them to.

When the furnace gets full, it actually causes the game to segfault for me, and then basically makes the world unusable after that.

Can't do anything about that unfortunately, it's a bug in the game.
I think there is a fix for that here.
An innocent kitten dies every time you top-post.

Nubelite
Member
Posts: 161
Joined: Mon Jul 16, 2012 23:10

by Nubelite » Post

This is just a question because i see this mod being used by many others and the item growth is exponential.

Do the number of item references, mod items, affect the game in performance?
like adding 10 items the game vs 100 or so. This is more for servers then single players but wouldn't mind knowing about both.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

While having more defined nodes definitely increases the game's startup time, I haven't noticed any active performance issues that I'd attribute to the number of defined nodes. Rather, it's things like your video hardware, driver quality, and your choice of texture pack resolution that has the most effect. Secondary to that are your various mods' ABMs, on-generate, and other similar code that runs actively. Just defining a bunch of nodes/items/crafts shouldn't cause any real impact as far as I know.

On the one server I've used so far that made use of this mod (by way of another of mine that depends on it, homedecor), there seemed to be no issues with performance in practice either. Of course, only a server admin can say for sure.

As long as you're not trying to cram tens of thousands of visible nodes onto the screen (that is, more than is normally seen), regardless of what they're defined as, you'll probably be just fine.

There was that issue in releases prior to 0.4.2-rc1 where too many defined nodes would trigger a seemingly-unrelated error regarding server/client versions, but that was due to a bug that has since been fixed (and the number of nodes limit was expanded also).
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Nubelite
Member
Posts: 161
Joined: Mon Jul 16, 2012 23:10

by Nubelite » Post

can't seem to get blue or purple to work. any ideas? I got a list of mods on my server if wondering what else im running.

Image

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

OOPS! I forgot to add those two recipes back in after adding the check+special option for the existence of geraniums. Fixed :-)
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Nubelite
Member
Posts: 161
Joined: Mon Jul 16, 2012 23:10

by Nubelite » Post

for the wool in the game "/giveme wool:white" the dyes can color it? is the recipe 1 dye and 1 white wool? I tried that and no luck also lol.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

It seems to work fine for me? I checked with 0.4.2-rc1 using bottles of black, red, orange, yellow, green, blue, and violet dyes. Note that the in-game wool supports only these colors:

White, medium grey ("grey"), black, red, yellow, green, cyan, blue, magenta, orange, violet, brown (dark orange), pink (light red), dark grey, and dark green.

Jordach's cotton mod supports the whole Unified Dyes palette.

The recipe is indeed one white wool block and one bottle of dye (yields 16 colored wool).
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Nubelite
Member
Posts: 161
Joined: Mon Jul 16, 2012 23:10

by Nubelite » Post

im using 4.1 so that might be it

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests