[Mod] Colorful [colorful]

Post Reply
User avatar
LMD
Member
Posts: 1396
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

[Mod] Colorful [colorful]

by LMD » Post

Colorful

This mod is a library for automatically registering all colored items/nodes of a type, as well as their crafts when combining two of them.

Example :

Xmas Balls Mod

Usage :
Spoiler

Code: Select all

--Mod : Colorful Library v1.1
--© Lars Müller @appguru.eu, licensed under GNU GPLv3
--Library Usage : 
--Functions : 
--Basic : 
--toHex <number> - Converts <number>(0-255) to a hexadecimal string
--round <number> - Rounds <number>
--Advanced : 
--Arguments : 
--<r/g/b_steps> - How many red/green/blue levels
--<a> - Alpha level of the colorize/color overlay
--<extreme> - If even r/g/b steps(dividable by 2) are added 1
--<generate_crafts> - Can a new color be crafted by combining two colors
--create_colortable <r_steps> <g_steps> <b_steps> <extreme> <nodename> Creates a color table, each <nodename> node is assigned to a color 
--save_colortable <r_steps> <g_steps> <b_steps> <extreme> <nodename> <save_as> Same as above, but saves the color table as .anl
--Register-Functions : 
--Note : , Color : Red : ..., Green : ..., Blue : ... is appended to the description automatically, #color in the tile/inventory/wield-image string is replaced with the color, if not specified, appended automatically
--register_all_nodes <r_steps> <g_steps> <b_steps> <a> <extreme> <nodename> <node(data)> <generate_crafts> <append> <save_as> 
--1. Append specifies whether the color should be applied to the drop, drop should be registered in same colors, except if you want to make the nodes drop themselves. Only works if a drop is specified in <node(data)>
--2. If save_as is set this function offers save_colortable functionality besides its normal
--register_all_items <r_steps> <g_steps> <b_steps> <a> <extreme> <itemname> <item(data)> <generate_crafts>
Screenshot :
Spoiler
Image
Colored stone and Schematic Creator used.
GitHub/Download/Source :

Colorful Library Source/Download

License :

CC-BY-SA 3.0

Changelog :
Spoiler
  • v1.1 : API modifications as automatical craft registration(color combining) and automatic drop
Dependencies :

None

Compatible with my Schematic Creator, as this mod is able to create .anl files also automatically !
Attachments
compressed.jpg
compressed.jpg (541.11 KiB) Viewed 390 times
Last edited by LMD on Sun Jan 28, 2018 14:12, edited 11 times in total.
My stuff: Projects - Mods - Website

User avatar
Andrey01
Member
Posts: 2577
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [MOD]Colorful

by Andrey01 » Post

Using the mod everyone can paint at any color something item or block?

User avatar
LMD
Member
Posts: 1396
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [MOD]Colorful

by LMD » Post

Nice idea, Andrey01 ! But currently, this mod just registers them. The image is generated by my Schematics Creator.
My stuff: Projects - Mods - Website

Sokomine
Member
Posts: 4287
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [LIB]Colorful

by Sokomine » Post

It's good to have a lib for that, but it's also causing trouble for me in the future. I eventually want to add support for color to the circular saw in moreblocks. Most of that code stands. Troble is: Shapes like those found there can only hold 8 colors. There has to be some translation between palettes. See Item coloring experiment with dyes for similar mods. And there's of course unifieddyes. And my colormachine has to handle all that somehow.
A list of my mods can be found here.

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests