qgis fails to create the legend when creating the colors of a map with the RGB data from the table - qgis

When creating a map style in QGIS 3.x from the attribute table, the RGB colors on the map are displayed correctly, but not in the legend - see screen shot. When exporting to a *.sld file, the wrong colors are exported.
wrong color in the legend
table example
LEG_FARBCODE_R | LEG_FARBCODE_G | LEG_FARBCODE_B
99 | 147 | 125
layer style code:
color_rgb( "LEG_FARBCODE_R" ,"LEG_FARBCODE_G" , "LEG_FARBCODE_B" )
the sld file looks like this (qgis automatically converts the rgb code to the hex code):
<se:Rule>
<se:Name>#729acf</se:Name>
<se:Description>
<se:Title>#729acf</se:Title>
</se:Description>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>rgb_hex_hex</ogc:PropertyName>
<ogc:Literal>#729acf</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<se:PolygonSymbolizer>
<se:Fill>
<se:SvgParameter name="fill">#c84621</se:SvgParameter>
</se:Fill>
</se:PolygonSymbolizer>
</se:Rule>
the colors of the features are calculated correctly, but the color of the legend is assigned randomly
<se:PolygonSymbolizer>
<se:Fill>
<se:SvgParameter name="fill">#729acf</se:SvgParameter>
</se:Fill>
</se:PolygonSymbolizer>
so the wrong colours of the legend don't match with the map
there is no error, but the wrong color in the legend.
tested on Win10 / Ubuntu-18.4, / OSX and QGIS-3.6.x u. 3.8

Related

How to generate light random colours in T-SQL

I have stored procedure running in T-SQL 2012 and got filed to generate random Hex colours which is all working fine except generated Hex code are in dark colour combination like dark blue, dark green etc. I need to generate light colour scheme, how can I do that.
SELECT
RecordId,
CONVERT(VARCHAR(max), CRYPT_GEN_RANDOM(3), 2)as [BarColour]
The method you use will produce light colors as well as dark colors. If you're only getting dark colors, it's just bad luck.
A starting point for generating only light colors would be to do something like this. It randomly generates the RGB values and concatenates them into your hex codes.
SELECT CONCAT(RIGHT(CONVERT(VARCHAR(100),CAST((ABS(CHECKSUM(NEWID()) % 135) + 120) AS VARBINARY),2),2),RIGHT(CONVERT(VARCHAR(100),CAST((ABS(CHECKSUM(NEWID()) % 135) + 120) AS VARBINARY),2),2),RIGHT(CONVERT(VARCHAR(100),CAST((ABS(CHECKSUM(NEWID()) % 135) + 120) AS VARBINARY),2),2))
I ran this repeatedly to output results 10 at a time and I got back a range of light grey-hues and pastels. This method won't give you any pure colors though as it completely avoids the low range values.

Unity built in colour picker

I am using Unity 2017 and I noticed that when I open the colour picker the color values appears in HSV values and not RGB.
On my second PC, the colour values are on RGB.
I have tried to look online how to change it, but Google doesn't seems to understand me and all the results are how to convert HSV to RGB in code.
All I want to do is set the built-in colour picker values to RGB
Thanks in advance
Inside the Image component just above the colour sliders there is a small icon showing 3 colour bars (a coloured one, and two black/white bars), clicking on this will swap between HSV/RGB values
It looks like this
In Unity 2019(alpha) they made it way clearer. If you click on the colour picker there will be a dropdown menu (located inbetween the colour wheel and colour sliders) with three options: HSV, RGB (0 - 1.0) and RGB (0 - 255)

Tableau show legends for lines charts on dual axis?

I have 2 lines in a chart and i used dual axis on them. For each line, i manually picked colors for them through the MARKS card.
Now I need a legend to show what each line and their color represent but i dont see any way to do it. When i put one of the pill on the colors box, it gives me a gradient of colors on my trend line which is not the color i manually picked by clicking on the colors box.
How can i go about doing this?
Using the "All" marks card (the top one), put Measure Names on the color shelf

How do you heatmap in tavleau a list of numbers based on another column data

I have data from 48 countries. I am trying to visualize it on a map. I want to display half the countries in 1 color and the other half in another color. This segmentation is based on another column which has string value 'yes' or 'no'. I want to do it on tableau
Country data OFF
------------------------
US 100,000 yes
IN 200,000 yes
BR 300,000 no
MX 150,000 no
I want to plot US, IN in Blue and BR, MX in green. The shades of green and blue are dependent on the values of data.
Have you tried to drag the OFF field to Color in the sheet? This should do the trick
You can put either the measure data on the color shelf to color by value, or the dimension OFF on the color shelf to color by OFF -- i.e. to use color to encode a single field's value.
If you want to color by two dimension fields, you can get the shading effect you mention by putting both on the color shelf -- using the shift key to add the second one if it's not in a hierarchy with the first one.
If you want to color by both a dimension and a measure (as in your case), you have to go to a little more effort -- assuming its worth it. You can make a calculated field that uses both fields to map into a category (say returning a string like "off yes, data high" or "off yes, data mid") and then edit the colors to map them as you like.

Change bar chart column structure

I change the column color in the bar chart but the problem that when i print the paper in black and white all columns look the same, so I am wondering if there is any way to change the column shape from inside (like cross or circles) so i can differentiate between columns in black and white ?
Thanks a lot
You may want to try, amongst others, this matlab exchange entry called Hatch fill patterns plus Color & Invert.