Blockland Forums > Modification Help

Color Translation

Pages: << < (3/6) > >>

Port:

This has nothing to do with hexadecimal color codes.

Nexus:


--- Quote from: Port on May 01, 2012, 02:40:18 AM ---This has nothing to do with hexadecimal color codes.

--- End quote ---

er wow I have no idea what I was thinking
My thing goes from 0-1 to 0-255 to 0-f

But I think my point about how you can probably keep everything in terms of 0-1 is still valid.
Unless you really want the user to be able to see the color in terms of 0-255, there is no reason to ever do a conversion.

Ipquarx:

If it is a value between 0 and 1, multiply my 255 and round down.
If it is a hexadecimal value, then you can use my base to base converter to convert it to decimal.
You can find it Here.
It's a very compact script, and does more than just hexadecimal conversions.

BTW, slider always adds decimal places, that's normal.
If you want the slider to snap to whole numbers, try setting the ticks to 254 or 253 and turning snap on.

Port:


--- Quote from: Ipquarx on May 02, 2012, 11:17:11 AM ---If you want the slider to snap to whole numbers, try setting the ticks to 254 or 253 and turning snap on.

--- End quote ---

what

set ticks to 0 and snap to false

jes00:


--- Quote from: Ipquarx on May 02, 2012, 11:17:11 AM ---If it is a value between 0 and 1, multiply my 255 and round down.

--- End quote ---
Thank you this works perfectly.


--- Quote from: Ipquarx on May 02, 2012, 11:17:11 AM ---If it is a hexadecimal value, then you can use my base to base converter to convert it to decimal.
You can find it Here.
It's a very compact script, and does more than just hexadecimal conversions.

--- End quote ---
So I'm to use this method to translate it from the GuiSwatchCtrl to the GuiSlider controls? If so which one do I use?

Pages: << < (3/6) > >>

Go to full version