Author Topic: Color extension  (Read 2509 times)

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Color extension
« on: November 01, 2012, 09:51:23 AM »
Hi !

Just to show you a useful class that quickfingers made, it's called ColorX and it lets you specify colors from 0 to 255, so code will be more clear.

http://www.quickfingers.net/quick-bites-01-color-extensions/

Maybe you could add this to NGUI by default ? If you find it useful of course...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Color extension
« Reply #1 on: November 01, 2012, 10:22:32 AM »
No reason to do this. You can just use "new Color32(255, 255, 255, 255)".

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: Color extension
« Reply #2 on: November 01, 2012, 10:25:42 AM »
Didn't know this existed thanks :)

But ColorX also take charge of hex colors !

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Color extension
« Reply #3 on: November 01, 2012, 12:58:33 PM »
NGUI has a method for that: NGUIMath.HexToColor.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: Color extension
« Reply #4 on: November 01, 2012, 01:19:16 PM »
Okay, so... i'm out :)