Kai_ColorPicker

by Kaiochao
[Share] [Zip]
To download this library for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://Kaiochao.Kai_ColorPicker##version=3

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://Kaiochao.Kai_ColorPicker##version=3

72 downloads
Version 1.0
Date added: Jan 19 2009
Last updated: Dec 3 2011
1 fan
Ever wanted to limit what colors your players can choose? Now you can. [More]
Really, this library is just in response to Jeff8500's post:
http://www.byond.com/developer/forum/?id=683508

Anyway, here's the proc you need to know:

colorpicker/proc/getColor(mob/m,rlo,rhi,blo,bhi,glo,ghi)
Parameters:
mob/m - The player choosing a color.
rlo, blo, glo - The lowest r/g/b setting allowed.
rhi, bhi, ghi - The highest r/g/b setting allowed.
Returns: rgb() value chosen by the player.

This proc is similar to input()as color, how it is a visual color selector, but with the ability to restrict players on how much red, green, and/or blue they are allowed to use.
It is a datum proc, so you need to call it like one. This library includes a mob variable, colorpicker, for easy access; just call colorpicker.getColor(). The result is the same as if you wanted to use the rgb() proc.

This library uses its own interface file. The window used for choosing colors is "colorpicker."

You'll need to transfer the window to your game's skin.
To do this:
- Open up Skin.dmf(included in lib), scroll down until you see "window 'colorpicker'". Select all the lines from there to the bottom.
- Open your game's skin, and paste it at the bottom of the file.

Advertisement

Comments

Katsuri: (Jul 14 2011, 8:41 am)
useful, yes. But I more tried to learn from it which was ridiculous since the thing is set up to be a library. I get to where I hate them...but at the same time...so useful...