Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by DanjelRicci · Jun 25, 2011 at 12:44 PM · guitextcolorfontlabel

Color.white not so much white...

I'm experiencing an annoying problem, or maybe a bug, in my iOS game.

I have a GUI.Label text with a custom font, wich I specified to be white using GUI.color = Color.white just the line before (so it's 100% opaque). Everything it's fine until I noticed it doesn't appear white, but light gray. This hapens both on the Unity Editor on Mac, and on the iOS App.

The strange thing is that, inside the Font asset, both the Font Material and Font Texture are perfectly crystal white, and so when I write with the same font in Photoshop. I think we can exclude a problem in the font itself.

This is nothing really problematic for the game, but it's affecting a bit the visual style. Did anyone of you have experienced something similar, or have solutions about this?

Thanks!

EDIT: Here it is the piece of code for the text.

    GUI.skin.font = LapFont;
    GUI.skin.label.alignment = TextAnchor.UpperLeft;
    GUI.color = Color.black;
    GUI.Label(LapTextRect4,"Lap "+(MC.myLaps+1)+" of 3");
    GUI.Label(LapTextRect2,"Lap "+(MC.myLaps+1)+" of 3");
    GUI.color = Color.white;
    GUI.Label(LapTextRect,"Lap "+(MC.myLaps+1)+" of 3");

This same code generates a perfectly white text in another game I have, with another font. Anyways here you are a comparative screenshot from the current game I'm working on, with the original font both inside and outside Unity.

Screenshot

Comment
Add comment · Show 9
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image flaviusxvii · Jun 25, 2011 at 01:43 PM 2
Share

A screenshot wold be nice.

avatar image DanjelRicci · Jun 25, 2011 at 05:50 PM 0
Share

Sorry but currently I'm not on my $$anonymous$$ac and can't upload that. I'll do it as soon as I'll be at my computer.

avatar image Marnix · Jun 26, 2011 at 07:48 PM 0
Share

A screenshot of the font itself would be nice too, being out of your unity game.

avatar image Waz · Jun 26, 2011 at 11:44 PM 1
Share

Definitely looks like a grey GUISkin color as explained below.

avatar image Waz · Jun 26, 2011 at 11:51 PM 1
Share

i.e. set:

 GUI.skin.label.normal.textColor = Color.white;

(though normally you'd do that by editing the skin in the inspector, not code).

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by Waz · Jun 26, 2011 at 01:13 PM

Is the text color for Label in your GUISkin set to White?

There are 3 values multiplied together that determine GUI label colour:

  1. The font texture pixels

  2. The current GUI.color

  3. The text color of the Label style in the current GUISkin

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DanjelRicci · Jun 26, 2011 at 07:26 PM 0
Share

As I wrote in the question:
"I have a GUI.Label text with a custom font, wich I specified to be white using GUI.color = Color.white just the line before"
This solution works perfectly on another game I have, but it's not in this case.

avatar image Waz · Jun 26, 2011 at 09:45 PM 2
Share

I've clarified above..

avatar image DanjelRicci · Jun 27, 2011 at 12:03 AM 1
Share

Oh, now I understand...
Since I were not using a GUISkin asset, I guess I have been using the default one wich should be white. But I just noticed that when you create a default GUISkin, the color for Normal Labels is RGB(230,230,230).
So I added "GUI.skin.label.normal.textColor = Color.white;" at the beginning of my code and now everything is perfect.

Thank you so much. :)

avatar image BerggreenDK · Jun 27, 2011 at 12:17 AM 0
Share

Good job Warwick!

avatar image
0

Answer by BerggreenDK · Jun 25, 2011 at 01:48 PM

Could it be some sort of color-management or bad lightning/low ambient?

EDIT

I believe its the pre-defined color tables because it seems that Color.White should be 0xE5E5E5 - but the PC might overrule this nonsens and thereby making it Mac OS/iOS related only in your situation.

http://www.google.dk/search?q=mac+color+white+is+e5e5e5

So use the RGB value of RGB(255,255,255)

Comment
Add comment · Show 8 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DanjelRicci · Jun 25, 2011 at 05:53 PM 0
Share

No, they're not. Color managment is correct (I have some bright white icons in the game), and ambient light doesn't affect GUI.

avatar image BerggreenDK · Jun 25, 2011 at 07:02 PM 0
Share

How about if you use RGB for the color ins$$anonymous$$d of Color.white? I am thinking if the Alpha could be active somehow?

avatar image BerggreenDK · Jun 25, 2011 at 07:03 PM 0
Share

what font-size? could it be anti-aliasing on the font?

avatar image DanjelRicci · Jun 26, 2011 at 12:20 PM 0
Share

I tried to use Color(1,1,1,1) too and different Font Antialiasing settings, but without results.
I use the same font whit different sizes, from 40 to 120, but it's still grayish.

avatar image BerggreenDK · Jun 26, 2011 at 07:46 PM 0
Share

Same problem with GUI.Text object?

Show more comments
avatar image
0

Answer by dretwy · Nov 25, 2014 at 11:54 PM

It should help GUI.skin.label.normal.textColor = Color.white;

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Changing the size of a GUI label 1 Answer

How do I change the font and color of GUI text? 1 Answer

Changing a GUILabel text SIZE 3 Answers

GUI.label overlapping text 1 Answer

Alpha not working in GUITex 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges