RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Trying to work on a hue's chart in VB.net

Marak

Sorceror
Trying to work on a hue's chart in VB.net

Im trying to get the hue's to display in a selectable chart in Vb.net, but not having much luck at the moment, anyone able to point me into the right direction? (i have not done that much work with array's before - which is what im assuming you would use)
 

Jeff

Lord
I know this isnt VB but for my GDK program I had to draw hue chart stuff and made this method.

Code:
        public static Color Convert555ToARGB(short hue)
        {
            int red = (((short)(hue >> 10)) & 0x1f) * 8;
            int green = (((short)(hue >> 5)) & 0x1f) * 8;
            int blue = (hue & 0x1f) * 8;
            return Color.FromArgb(red, green, blue);
        }

And what you can do is take Hue.Colors and for each of the short values in Hue.Colors you pass it through this and it will return a 32 bit color to use as you please.
 

arul

Sorceror
Marak;723508 said:
Im trying to get the hue's to display in a selectable chart in Vb.net, but not having much luck at the moment, anyone able to point me into the right direction? (i have not done that much work with array's before - which is what im assuming you would use)
Code:
Public Shared Function GetColorFromHue(ByVal hue As Short) As Color
    Return Color.FromArgb(((hue And &H7C00) >> 7), ((hue And &H3E0) >> 2), ((hue And &H1F) << 3))
End Function
 

Marak

Sorceror
Thankyou arul! - and jeff :)

I dont think i would have figured that one out :p

EDIT:

Thats used for a vectorial graphic draw right? im reading up on those now, definatly have not coded these before :s

Edit 2:

Thankyou i have gotten it to work, sortof haha.
 
Top