ID:133925
Sep 19 2007, 3:35 pm
|
|
Possibly in a future release, the ability to define an icon's Hue, Sat, and Lum, like we can it's RGB, with the rgb() proc.
|
In response to Lummox JR
|
|
Hue sat and lum are done in numerics like RGB so couldn't it work on the same principle?
|
In response to Body
|
|
My sd_procs library includes two procs to convert between RGB and HSL values.
hsl2rgb(hue, sat, lgh, scale = 240) Returns the RRGGBB format of an HSL color. ALTERNATE FORMAT: hsl2rgb(HSL, scale) ARGS: hue - hue sat - saturation lgh - light/dark HSL - a hex string in format HHSSLL where: HH = Hue SS = Saturation LL = light scale - high end of the HSL values. Some programs (like BYOND Dream Maker) use 240, others use 255. The H {0-360}, S {0-100}, L {0-100} scale is not supported. DEFAULT: 240 RETURNS: RGB color string in RRGGBB format. rgb2hsl(red, grn, blu, scale = 240) Returns the HSL color string of an RGB color ALTERNATE FORMAT: rgb2hsl(RGB, scale) ARGS: red - red componant {0-255} grn - green componant {0-255} blu - blue componant {0-255} RGB - a hex string in format RRGGBB scale - high end of the HSL values. Some programs (like BYOND Dream Maker) use 240, others use 255. The H {0-360}, S {0-100}, L {0-100} scale is not supported. DEFAULT: 240 RETURNS: HHSSLL color string You can use "#[hsl2rgb(hue, sat, lgh)]" anywhere that you could use rgb(red, grn, blu). For example: I.Blend("#[hsl2rgb(0, 240, 30)]") has the same effect as I.Blend(rgb(40,0,0)) |
You can achieve this with the new icon.MapColors proc in 4.0.
I've cooked this up, and it seems to work fine as far as I can tell. Just make calls to icon.SetBrightness, icon.SetSaturation, icon.OffsetColors, and icon.RotateHue to modify an icon. // http://www.graficaobscura.com/matrix/index.html Example usage: mob |
In response to Shadowdarke
|
|
I completely forgot to search the demos and libs for this sort of thing. My mistake guys. It isn't that I thought BYOND was in dire need of this proc but I figured somewhere down the line it wouldn't hurt to put it in. It could become useful to someone eventually, (obviously since someone has already made a proc for it) so I just figured I'd suggest it. Thanks for the responces guys.
|
I'm not sure how you'd apply this, because right now RGB is mostly applied to an icon by adding, subtracting, or multiplying.
Lummox JR