[SOLVED] Color c = New Color(0,0,255); problem

Hello there. I am trying to draw a sprite and change its color to blue…it should be simple.
If i try pure red or Green its ok, but when o try blue, it dosent work… Any ideas?

Hmm… Well, that sounds strange!

What happens if you assign the color in a different way? - Like using Color.Blue or new Color(0f,0f,1f)

Is your sprite Monochrome/Greyscale?

EDIT

Also welcome to the forums!

1 Like

Hello,
no, The sprite its not mono/grayscale as i am just testing stuff right now. The thing is The sprite simply dosent change color at all with The blue tint.

It is strange and i can bet i am just doing something stupid.
I tryed doing The Color.blue and using float and working with The alpha…no change

Have you tried other forms of blue? e.g. CornflowerBlue? it could be your IDE not processing the value, can you test on another machine perhaps?

If you only have 1 machine, you can do a couple of things… Hyper-V if you are on Windows 8/10 and install your existing licence on it, a bit of a controversial thing to do but I do not see anything wrong with it as it is still the same system and OS variant… go with what you know best…

Another method similar to the above would be to install another copy of the OS side-loaded… kind of Dual Booting… so that you can see if it is related to your setup/IDE…

Both of the above allow you to test on a clean install environment and as an added bonus, you get to test your developments against a scenario where no dev tools are installed i.e. similar to a user system… :wink: [If you are publishing for desktop scenarios]

Both require you to have the install disk of your host OS by the way.

If you have another system to test on, well go for it…

Otherwise hopefully there is an easier or quicker method to resolve this…

Are you using a dev branch?

I should compile a copy paste list of typical questions soon :stuck_out_tongue:

Valentine.

Ty for your reply. I do have another system to test it in and i will do that Today and let you know.
I will also test it with a grayscale image.

I Wonder if this could be caused by an option on draw.begin…

I am from Brazil and my autocorrect hates english :confused:

Post some code! Attach your assets! Create a minimal solution (the simplest thing possible) that reproduces the problem.

Let us know OS and MG version info too.

1 Like

Maybe the sprite itself is just unsuited for blue, … maybe you can upload a picture of the sprite here, and I can test it :slight_smile:

On a previous forum I got non-native English speakers to post in both languages so that we could try various translator apps to see if the translation got the message across better than the user could explain, So feel free to post both, but ideally always post in English as well as in your native language [And mark it as what language it is in English lol for example, Danish and Swedish are extremely similar although the mannerisms are different]

If we wish to help you we will take the effort to translate, it is usually a case of copy paste in another window/app side by side; so go ahead :slight_smile:

However I think we understood you so far :slight_smile:

EDIT

I was going to add, it would help if you used proper language so that the translations can translate correctly, I felt this would come across as rude but then I saw that you user Ty instead of Thank You, if you use such slang in your original language then it would make no difference if you typed in English so… yeah… there was that too…

ha, 3 in a row… nice

1 Like

I think we need a page that consists of the usual schematic of providing XYZ data instead of us repeating things and sounding slightly arrogant, I might work on this soon and get @Tom to consider adding a template somewhere… I could create one for each subject area such as Graphical Issues, Code issues, and such… as well as a base generic list too…

Base generic would contain the standard rap sheet of what OS, IDE, System Specs etc…

Where in Graphical issues would include the base list and say things like add images, screenshots, video…

And Code similar to graphical with attached Objects etc. omitted or something…

I should probably spin this off to its own thread I think… and round up suggestions of what to add to it… I think it would shorten threads to the precise point and reduce time spent asking slightly/wholly obvious questions… especially where newcomers are concerned…

Sorry for going off-topic…

Kkkk
Its almost funny how helpfull you guys are…lets just say i was not expecting this or would no post my question before bed and going to work.
Yes, i know i should post some code and add The assets, but i was hopefull it could be some know issue or common bad usage of my part.

Will do my part and post The info needed as soon as i get home.

Ty all :slight_smile:

Ps: its hard to write in english when its not your native Language and your autocorrect is trying to turn english words into portuguese ones :confused: i should do one post without any corrections so you can see

1 Like

I find this community to be exemplary I only started using it properly this past week, So I wish to see if I can add to that helpfulness as I can see the value this community brings.

1 Like

Sounds annoying for you, but at least we understand you just fine… Keep it up :slight_smile:

There you go. I got home and made a grayscale image and it work fine.
I still think its weird the way this works, but again i don’t understand fully how this works…

Orignal image:

grayscale one:

if anyone could point me to a good explanation on why this works like this, please do :slight_smile:

Thank you all anyway for the help!

Its because the original image contains all yellow, the mix of Red and Green… The color you draw a sprite in, is like the color you let through… If you let through NO red, and NO green, and MAXIMUM blue, then your yellow image is completely black, because even 100% of the blue channel is still zero…

If you want to change the color of a sprite accurately, it has to start out white-ish :slight_smile:
That way, if you let through only the blue (draw in blue) the blue channel is preserved…
Going from 255,255,255 to 0,0,255

1 Like

got it…this makes sense now…its not a tint but a filter.

Ty for this

Glad to help. Dont forget to mark the topic as [SOLVED]

1 Like

I only figured this out because I just studied this a couple of days ago. :grin:

Glad you got this resolved already. :slight_smile: