How to draw several contours label in separate colors

Good morning. I have two equations (or more) that I want plot with ContourPlot colored with different colours and labelled according to equation order, in a automatic way. I have tried several solutions without success. My plot should remain as

g1 = x + 2 y; g2 = 2 x + y; b = {2, 2};

coloresRest = {Blue, Magenta}; labelRest = Table[Text[Style["(" <> ToString@i <> ")", coloresRest[[i]]]], {i, Length@coloresRest}];

ContourPlot[{g1 == b[1], g2 == b[[2]]}, {x, -2, 4}, {y, -2, 4}, Frame -> False, Axes -> True, ContourStyle -> Thread[{coloresRest, grosor}], Epilog -> {Text[Style["(1)", color3], Offset[{20, 0}, {-2, 2}]], Text[Style["(2)", color4], Offset[{-10, -10}, {-1, 4}]]}, ImageSize -> 400]

enter image description here

I have tried with Table, ContourLabel, Riffle or Epilog, without success. For example:

ContourPlot[{g1 == b[1], g2 == b[[2]]}, {x, -2, 4}, {y, -2, 4}, Frame -> False, Axes -> True, ContourStyle -> Thread[{coloresRest, grosor}], ContourLabels -> Table[Text[Style[labelRest[[i]], Offset[{10, 0}, {#1, #2} &]]], {i, 1, Length@coloresRest}], ImageSize -> 400]


ContourPlot[{g1 == b[1], g2 == b[[2]]}, {x, -2, 4}, {y, -2, 4}, Frame -> False, Axes -> True, ContourStyle -> Thread[{coloresRest, grosor}], ContourLabels -> {Riffle[coloresRest, Inset[labelRest, Offset[{10, 0}, {#1, #2} &]]]}, ImageSize -> 400]

I realize that expresión {#1, #2}& yield coordinates for labels, choosen by Mathematica. I’d prefer that and not to choose such coordinates.

Thank in advance

Mixing colors at the intersection of tiles in Slick2D

I’m just learning Slick2D.
Can you please help and tell me how to properly mix colors on adjoining tiles? I would like to get the same effect as on the right in the picture.

Right now, I’m just using the Image.draw(x, y, Color) method. The color is applied, but it is different between tiles. (the sprite in the example is the same)

enter image description here

Interpolating vertex colors with trilinear coordinates instead of barycentric

In 3D graphics, vertex attributes like vertex normals, texture coordinates, and vertex colors are interpolated over the surface of triangles using barycentric coordinates. In actual fact it’s more complex than this and there’s a rabbit hole of perspective correct adjustment and all sorts, but indulge me for a moment. Here’s what this looks like for vertex colors, and Mathematica handles everything about the interpolation behind the scenes:

vtxs = {{0, 0}, {0, 1}, {1, 0}}; cols = {Red, Green, Blue}; tri = Polygon[vtxs, VertexColors -> cols]; pt = {1, 1/2}/2; Graphics[{tri,   {Yellow, PointSize[Large], Point[pt], Line[{pt, #}] & /@ vtxs},   MapThread[    Text[Style[#1, FontWeight -> Bold, FontSize -> 24], #2] &,      {{"R", "G", "B"}, vtxs}],   Style[{Text["u", {.3, .1}], Text["v", {.2, .65}],      Text["1-u-v", {.7, .1}],      Text[TraditionalForm[p], pt + {1, 1}*0.04]}, White, FontSize -> 24]   }] 

barycentric vertex colors

The color at $ p$ is a weighted combination $ p_c=Rw + Gv + Bu$ where $ (u,v,w=1-u-v)$ are the relative areas of the subtriangles such that $ u+v+w=1$ .

I want to find a reasonably efficient way to interpolate the colors for any triangle without using barycentric coordinates, but using trilinear coordinates instead, and see what images this creates.

That is, we drop a perpendicular to the nearest edge and get a point on that edge, possibly indexing into the $ RG,GB,RB$ gradients along the edges, and then weighting the combination of these colors by the trilinear distances or areas of the three regions – whatever is more appropriate as it’s all experimental. Any other suggestions for how to interpolate vertex colors using trilinears is welcome.

trilinear interpolation

This is my code so far. The next step is to interpolate the corner colors over a pixel grid and make an image, instead of a Graphics with a single point:

SeedRandom[123456789]; poly = RandomPolygon[3]; shell = RegionUnion[MeshPrimitives[poly, 1]]; nfs = RegionNearest /@ MeshPrimitives[poly, 1]; rds = RegionDistance /@ MeshPrimitives[poly, 1]; centroid = Mean[First[poly /. Polygon -> List]]; Manipulate[  Graphics[{FaceForm[None], EdgeForm[Thick], poly, Orange,     Line[{p, #[p]}] & /@ nfs, Point[centroid]}], {{p, centroid},    Locator}] 


Can a twilight domain cleric see colors in dim light?

The description for the Eyes of night feature states:

You can see through the deepest gloom. You have darkvision out to a range of 300 feet. In that radius, you can see in dim light as if it were bright light and in darkness as if it were dim light.

Does this mean that a twilight domain cleric can discern colors in dim light or do the normal rules for darkvision apply here that state you cannot discern colors in darkness? The way I see it a twilight cleric should be able to see colors because the feature doesn’t say that you cannot see colors. Is that the correct interpretation?

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

Different background colors on different dates in DateListPlot

I have a time series plot

DateListPlot[{1, 1, 2, 3, 5, 8, 11, 13, 17, 21}, {2000, 8, 6}] 

I would like to have a background which is white upto Aug 10 and yellow from Aug 10 on to enphasize these later days. In general: how can you have different background colors on different dates?

I think I saw this done in the documentation center, but cannot find where.

Can you suggest how to do it?

Coloring a graph with odd number of vertices with $k$ (which is close to $\Delta$) colors in linear time

We have an undirected simple connected graph with odd number of vertices. We also know the number $ k$ which is actually the closest odd number greater than or equal to $ \Delta$ . (So if $ \Delta$ is even, $ k = \Delta +1$ else $ k=\Delta$ .) i.e $ k$ is the least odd number that is greater than or equal to degrees of all vertices.

We want to find a linear time algorithm that colors the graph with $ k$ colors.

I am very new to graph coloring algorithms. I know that a greedy algorithm is actually linear time and can color the graph with $ \Delta +1$ . But I can’t guarantee I can color it with $ k= \Delta$ when $ \Delta$ is odd. Also, we probably should use all the information the question gives us. i.e using odd number of vertices somehow, but greedy algorithm don’t use this extra information.

How can I solve this?

Do we need to follow brand colors for data visualization?

I am working on a design language project for our product. I’m currently putting together a color palette for data visualization part of the app. Based on my research on colors for visualization and careful consideration of color theory, and accessibility, I came up with a set of colors (muted color palette) that would blend well with the UI. I worked it off the brand colors. Because our primary brand colors are Orange, Grey, and Green and ours is a typical network/device management app.

So, the question is: do we need to use brand colors for data viz?

Of course, the product UI conforms to the brand colors. However, I feel the chart colors not necessarily be restricted to the brand palette for a couple of reasons:

  1. The marketing team which originally came up with the brand colors would not have thought about colors that would work well for Data viz. And I think they are more of a brand guideline that’s suitable for the promotional/marketing material and for the corporate website. They don’t seem to fit the bill for chart colors. We do have secondary and tertiary colors. So some of the colors I’ve come up with are derived from the secondary and tertiary colors and I’ve reduced the saturation level so that it’s easy on the eyes.

  2. It is an NMS app, orange and grey (primary brand colors) has some meanings in our app context (e.g., error, severity, others/unknown etc.,)

Should the chart colors represent the brand? Are there any guidelines on this? If someone could point me to some best practices, it would be helpful.

Is using different colors for internal and external links OK or what?

I’d like to use different colors for internal and external text links. Please tell me if you think this is a good or bad idea.

I’m considering CSS choices on a new site/web app which will contain article pages that have a lot of internal (same site) and external (another website) linking. By providing a colour identifier the visitor will then know if the link keeps them on site or about to head off to another site.

I’ve considered box arrow icons but they look unsightly when an article has a lot of external links.

Please if you have any examples of sites/studies which demonstrate this working or failing, it would be great to hear.

Thank you