Color Utilities Extension
Welcome to the Color Customization Zone! With the Color Utilities Extension, you can adjust colors at runtime, as well as define colors using HSL and hex values. You can use these blocks to modify an image, adjust color attributes, or even put a color-selection tool in-game!
NOTE: This is my first extension, so it might be a little sloppy. Please post how you think I can make it better!
I know that it works on Flash and Windows. (Please let me know if it works on Mac, Linux, iOS, or Android!)
Designed to work with Stencyl v3.1. Do not use in Stencyl v2.2 or below!Features
- get, set and shift RGB/HSL values from colors
- get negative or opposite versions of colors
- define a color with HSL or hex values
- Sample project
(try it below!)(How to Install and Update an Extension)
Returns a color value (red, green, blue, hue, saturation or lightness) from a color.
Returns the color that was put in, but with a color value set to the input number.
Useful for editing a color attribute.
Returns the color that was put in, but with a color value changed by the input number.
Useful for performing tasks like hue-shifts on images, or editing a color attribute.
Returns the negative or opposite of the color that was put in.
'negative' reverses each RGB value, while 'opposite' reverses the hue value.
E.g. Light green
, when made negative, would create violet
; on the other hand, when made opposite, it would create pink
Converts an HSL value into a color.
The hue is a number from 0-359 (it automatically loops around, so 360 = 0).
Saturation should be between 0-160, and lightness/luminance between 0-240. Both are self-adjusting, so any value outside the range will work, but will be replaced by the maximum or minimum value.
Converts a hexadecimal value into a color.
Upper- and lower-case are completely interchangeable; even aF0eDc
The block can also handle many formats, including six-digits like ffffff, #ffffff and 0xffffff, and three-digits like fff, #fff, and 0xfff.
1.0 - Initial release (08/09/14)
- get/set/shift (R, G, B, H, S, L) value from color
- negative/opposite of color
- hue, sat, lum as color
- convert hex to color
- Minor updates to the haXe files and Manual.txt.
- Minor updates to the code and sample, as well as laying the base for the next update.Planned features:
- get/define color by name
- pre-defined list of all HTML colors
blocks for adjusting images
- This can already be achieved with effects
If you have any questions, problems, or suggestions, feel free to post them!