How do I apply colors to a multi color svg in flutter? - flutter

I am looking for changing colors of an illustration svg in flutter. I tried flutter_svg package but it support applying only one color to the svg and if I do that svg will be displayed as a single color svg, individual colors are lost. Is there any way to change colors at runtime in flutter for a multi color svg?

Do you mean something like this? I call it SVG colorization.
I'll try to squeeze the concept into a short summary. In an SVG file, you need to play around with the fill property as it defines the hex color code.
In terms of programming, you would:
Extract the SVG file data as a String variable svgCode.
Assign the previous hex color code in previousColor & the currently selected hex color code in newColor.
Apply the String.replaceAll method on svgCode to replace the colors.
Update the value of the previousColor.
A more brief elaboration would be
/// Initially without any color selection.
SVGPicture.string('''<svg code with fill #f7ebcb>''');
/// After the user selects the red color.
SVGPicture.string('''<svg code with fill #FF0000>''');
This tutorial can help to solve your issue. Not only does this app changes the color on runtime, but it also allows the user to download the manipulated SVG code.

Related

How can I customise colors in the highlight section that is different from the text colors?

Image to the issue
How to give custom colors for highlights different from text colors.
The documentation states that the color_map setting sets both of them.
Additionally looking at the source code you can confirm that this is not currently possible as both swatches get the colors from the same function.
See
https://github.com/tinymce/tinymce/blob/develop/modules/tinymce/src/themes/silver/main/ts/ui/core/color/ColorSwatch.ts#L135

Is there a more customizable way to create embedded hyperlinks?

I'm trying to create a generalized function/class that builds embedded hyperlinks. I am using an NSAttributedString with NSAttributedString.Key.link attribute and assigning a URL to the specified range. I can even specify multiple links within the body of text, with specific styles for the text. However the only caveat that I am seeing is that the highlighted state of the links have a grey background color. Is there a way to get rid of this background color, and on top of that assign a specified highlight state color for the link?
I am open to other means of creating the text and links, but I feel like NSAttributedString is the right means.
Again:
the body of text should be able to handle any number of links
each link can contain any number of words
the highlighted state shouldn't have a background color of grey, and be able to accept a specified color for a highlight state
the text should be able to wrap if needed

Dynamic background in nattable

I am reading some data from a javascript file and obtain the background color from it, it seems very simple but I cant find the proper function to dynamicly changed the background color base on these values. I have already tried changing configurations but it doesnot work, beacause the group of configlabels is not available for this colors.
BR,

OpenXML SDK PowerPoint set chart color

I am writing a module for a VB.NET web page, which takes values from a database and inserts them into Office documents. Using the Open XML SDK in Visual Studio, I have managed to modify both Excel and PowerPoint files, but I have an issue with the color in PowerPoint's charts:
How can I change the color of a PowerPoint chart using the Open XML SDK, without also making the color separate itself from the theme?
Details below.
After adding my values to the worksheet behind the chart, and updating the visual lines/bars, all of the series appear to be using the same color. Therefore I also need to set the color of the series in the chart. I currently do this with the following code:
Dim barChart1 As DocumentFormat.OpenXml.Drawing.Charts.BarChart = chartPart.ChartSpace.Descendants(Of BarChart).First
Dim barChartSeries = barChart1.Descendants(Of BarChartSeries).ToList
barChartSeries(0).ChartShapeProperties.Descendants(Of SolidFill).First.SchemeColor = New SchemeColor() With
{ .Val = DocumentFormat.OpenXml.Drawing.SchemeColorValues.Accent4}
Basically, I set the first bar in the chart to use Accent4 as its color. Accent1, 2, 3 and so on correspond to the colors in the color palette of the PowerPoint presentation's theme. After this code runs, the first bar of the chart will be using the fourth color of the current palette.
The problem I'm facing is that after the color is set with code, the color value appears to be saved separately from the actual theme colors.
If I open the PowerPoint file and change the theme, all colors change except the ones I modified. In this example, the first bar of the chart would keep the fourth color for the previous theme, instead of using the fourth color of the new theme as it's supposed to.
This becomes a problem because my company's clients are supposed to be able to change the theme to one that suits them better, but they can't do that easily if some of the colors stick.
I'm using the Accent colors because the alternative seems to be setting an actual RGB color value, which leads to the same problem. I have tried the PowerTools plugin by Eric White, which simplifies the process of updating the charts, but it does not appear to solve the color problem. I may be using it wrong, but I've been unable to find specific info on how to debug color issues.
Thank you in advance for any help.
I'm not sure if this is true for VB.NET and OpenXML, but in the PPT object model, Scheme colors are still supported to maintain compatibility with pre-2007 versions of PowerPoint. New versions use color themes, not schemes. (yeah, I know. Welcome to the BizarroWorld that is PowerPoint).
In VBA, you'd use something like this to set the fill color of the shape referred to by oSh to Accent Color 2 in the current color THEME.
oSh.Fill.ForeColor.ObjectThemeColor = msoThemeColorAccent2

Get Background Color from HTML

While converting HTML to PDF, I am not getting background color applied for the text where as fore color working fine. When I debug, I found that Chunk object does not have that background color which is taken from HTML that contains background color.
Is there any way that I can find chunk background color, so that I can set it by using SetBackground method? I am using HTMLWorker.ParseToList Method and adding elements with customized formatting in pdf but want to get font background color from HTML.
sorry not possible. Even I faced this problem