solid color to sprite (javascript game)

Hi I recently created a javascript game, in this game, math random is used to pick a random shape.

The shapes are in strings, and the associated numbers within the string are then used to show a color.

Is there any way to replace the simple hex colors with an image?

For example:

else if (shape === "H"){     return [[8,8,8],             [8,8,8],             [8,8,8]]; 

The "8" ties into the following string to get the #F10B38 color.

const color = [null,"#FF2D00","#FF9300","#51FF00","#00FF93","#0087FF","#4E49A7","#9649A7","#F10B38"]; 

Assign a color to VectorPlot

I want to set all the lines in a VectorPlot a specific color, like Red. I am using some of the new options for VectorPlot as my code below illustrates. Using VectorColorFunction -> Red does not solve my problem.

Thank you for your assistance.

VectorPlot[{1, t - x}, {t, -2, 2}, {x, -2, 2}, VectorPoints -> 17,  VectorScaling -> Automatic, VectorSizes -> 1.2,  VectorStyle -> Arrowheads[0], VectorColorFunction -> Red] 

Suggest allowing new color brackets

By now I have spent a bit of effort in writing Mathematica notebook for my analysis tasks and appreciate the power of the Mathematica language. At the same time, I also discover that a significant fraction of my time had been spent on balancing the (, [ and { bracket, or scratching my head to discover that the weird results I got were due to improper placement of the closing brackets. I wonder if the code developers have considered allowing different colors to make my chore easier. An example may be that every time an open bracket is invoked, whether (, [ or {, a new and different color is attached to that bracket, and likewise, at closing. In this manner, if an improper placement is made, I would discover it immediately. Just a suggestion.

Why was 24-bit color support introduced twice in GPUs?

I was doing research, trying to answer the question "Which was the first GPU to support 24-bit color". I know all color since 1992 is 24-bit, even in games like Doom. I mean 16 million simultaneous colors on the screen, not just 256 unique colors from a 24-bit palette.

I started digging, and naturally I came across the ATI Mach 32. Later I find out that RIVA TNT also "added" support for truecolor. So I’m left wondering, is 24-bit color support some ancient technology that was forgotten after 1992 and rediscovered in the year 1998? Or are they talking about something different?

I have two guesses, but I’d love to know the real explanation:

  1. Truecolor support in RIVA TNT meant it’s hardware accelerated, as in the sprites are stored in the VRAM, as opposed to the Mach 32, where the VRAM is just a frame buffer so acceleration would be considered software.
  2. Nvidia meant 32-bit color texture, not even talking about frame buffer pixel depth.

Anyone know what both Nvidia and ATI really meant?

Dark color on codes problem

I’m reading How to Design Programs using DrRacket.

When I wrote the following codes as

(define (sign x)  (cond  [( > x 0) 1] [( = x 0) 0] [( > x 0) -1])) 

then I get dark color on codes as following

enter image description here

Why did I get it? Can you explain it? Thanks

Note: I’m new here if the tag is false, then can you edit? And can you help with tags?

I am looking for a way to assign numerical values to colors (then interpolate a color scale) and then assign numerical values to comparative colors

Hello may name is Chris

I am completely new to programming (but I love it!! I am learning Swift).

I am currently looking for a solution to the mentioned problem. I’m not sure if it is a ML task or if it is better to do it in the traditional way – maybe by comparing and interpolating RGB values. How I imagine that might be easier to understand in the video.

VIDEO (is there a better way to provide a video?)

The color values ​​below were taken before the adjustment and assigned to the assigned values ​​0, 2, 5, 10, 25, 50 and 100. The round section is taken from a photo (by light and shadow you can see that not every color value brings a perfect match. But that shouldn’t be a problem (I hope so) by comparing the pixels and evaluating the color value with the most matching colour at the end). My spontaneous manual evaluation gives a value that should be around 19-20.

I have already thought back and forth whether it is possible to do the whole thing using color values ​​(e.g. R G and B) but that is not so easy since there should also be many different results depending on the color format I am working with.

On the other hand, I don’t know how to solve it using ML. It would be easy to recognize the exact color values ​​0, 2, 5, 10, 25, 50 and 100 – but how can I have intermediate values ​​determined? What do you think? Which approach is the better one? If you have a tip for me, that I know in which direction I have to think further would be great! And if you have an idea how I can work on my problem I would be so grateful!!! … otherwise I think I will need the coming days to find some solution.

Thank you in advance! Chris