question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please ensure you have given all the following requested information in your report.

Issue details

rgba color is wrong.

Reproduction steps/code

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;

  FreeTypeFontGenerator.FreeTypeFontParameter parameter2 = new FreeTypeFontGenerator.FreeTypeFontParameter();
            parameter2.size = 80;
            parameter2.color =  new Color(255, 155, 0, 1);
            parameter2.borderWidth = 4f;
            BitmapFont font2 = generator.generateFont(parameter2);
            font2.draw(batch, "TEST!!!", x, y);

Use any color picker to see color, it should be darker yellow. Between orange and yellow. But rendered always Color.YELLOW not rgba.

Version of LibGDX and/or relevant dependencies

Gdx version: 1.9.8

Stacktrace

No stack trace, just wrong color.

Please select the affected platforms

  • [+] Windows

Not tested other platforms yet.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
Daahriencommented, Feb 6, 2019

I propose a new constructor that takes the first two arguments at 0-255 and the other two at 0f-1f.

0reactions
BonBonSlickcommented, Feb 24, 2019

@yuripourre thank you 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Question - RGBA Color Code Sets Wrong Color - Unity Forum
I have a randomly generated number and based on that number the gameobject's color will change. I have this code: switch (randomNumber) {......
Read more >
Receive incorrect alpha channel when convert rgba color to hex
In order to convert rgba color with alpha channel to hex I use the code. let rChannel = 255; let gChannel = 255;...
Read more >
rgba() - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
The rgba() functional notation expresses a color according to its red, green, and blue components. An optional alpha component represents ...
Read more >
CSS RGB and RGBA Colors - W3Schools
RGBA color values are an extension of RGB color values with an alpha channel - which specifies the opacity for a color. An...
Read more >
scss file -> wrong rgba css output - CSS-Tricks
My Problem is a bug in scout, but there is a workaround for handling rgba correctly: you have to use “rgba(255, 255, 255,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found