User Tag List

Results 1 to 9 of 9

Thread: [Extension Proposal] RGB to HSL

  1. #1
    No Products Registered

    Join Date
    Oct 2008
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Extension Proposal] RGB to HSL

    What an extension like this would do is take RGB (red, green, and blue) data and let the user be able to retrieve the HSL (hue, saturation, and luminance) data; and vice versa.

    I do not need this particular function in anything I'm working on, but this could be useful in an image manipulation program, where you might want to be able to apply a grayscale effect to an image without using a shader.
    (Grayscale, for those who do not know, works by taking the luminance of each pixel of a picture and applying it to the red, green, and blue values of that pixel.)

    Alternatively, if there's any calculations one could do that would be able to find HSL from RGB, please let me know.

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Extension Proposal] RGB to HSL

    The more I think about this idea, the more I like it! I'd suggest it to be implemented in form of expressions that follows the same system as the current ones. Each currently existing colour expression could be complemented by another one for the HSL system.

    [color:#3366FF]GetRGB(>Enter red value<, >Enter green value<, >Enter blue value<)[/color]
    ...would be complemented with:
    [color:#3366FF]HueToRGB(>Enter hue value<, >Enter saturation value<, >Enter brightness value<)[/color]

    [color:#3366FF]GetRed[/color], [color:#3366FF]GetGreen[/color] and [color:#3366FF]GetBlue[/color]
    ...would be complemented with:
    [color:#3366FF]GetHue(>Enter RGB value<)
    GetSaturation(>Enter RGB value<)
    GetBrightness(>Enter RGB value<)[/color]

    That way, the internal colour value that MMF2 uses will remain the same for both systems, and you'll have easy conversion between them in both directions. If this feature won't be added to MMF2, it would make sense to have this is form of an extension.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: [Extension Proposal] RGB to HSL

    I'll do it.. what's the algorithm?

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Extension Proposal] RGB to HSL

    I googled for it, but there aren't that many examples. The only thing I found is an article about how to do it in C# and VB, which can be found here. Perhaps you can look at that to figure out how the conversion actually happens? I have to say it looks quite complex.

  5. #5
    Firecodemonkey

    Join Date
    Aug 2006
    Location
    London, UK
    Posts
    461
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Extension Proposal] RGB to HSL

    Ask and ye shall receive

    Colour Converter updated for MMF2 (now that's December's old-extension-conversion quota exceeded - and it's only been half an hour!)

    It was my first extension... how easily it was forgotten :cry:

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Extension Proposal] RGB to HSL

    It looks like it works, but I think it would be more useful in form of the four expressions that I described in my previous post, since they are more consistent about how MMF2's current colour expressions work (and a lot easier to use too).

  7. #7
    Clicker Fusion 2.5 Developer

    Join Date
    Jan 2007
    Location
    USA
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Extension Proposal] RGB to HSL

    Nice!

  8. #8
    No Products Registered

    Join Date
    Oct 2008
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Extension Proposal] RGB to HSL

    :U

    Awesome. I will have to try that.

  9. #9
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Darkhog's Avatar
    Join Date
    Jan 2009
    Location
    /dev/null
    Posts
    417
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ChrisB View Post
    Ask and ye shall receive

    Colour Converter updated for MMF2 (now that's December's old-extension-conversion quota exceeded - and it's only been half an hour!)

    It was my first extension... how easily it was forgotten :cry:
    Sorry for digging up such an old thread, but you seem to have your PMs turned off. Any way you could port this extension to other runtimes (I need it for HTML5 in particular).

Similar Threads

  1. [Proposal] Rotate Window
    By Bedziu in forum Extension Development
    Replies: 13
    Last Post: 3rd December 2008, 05:32 PM
  2. [Proposal] SpriteSheet Extension
    By TwiTerror in forum Extension Development
    Replies: 90
    Last Post: 25th November 2008, 07:53 AM
  3. automatic icons - proposal
    By the_raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 28th July 2006, 08:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •