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.
In my application the users can create a list of names associated with icons and colours. I've got the data stored in a GtkListStore and displayed using a GtkTreeView. The colour column is a GtkCellRendererText with the background-rgba property holding an opaque colour selected by the user. It looks like this.
However as you can see the selection bar hides the currently selected colour. The colour definition I've used in the CSS is alpha(#cce8ff, 0.5) and I know that the alpha is working because the colour fades out when I decrease the alpha value.
What I want is for the background colour in the cell to be visible through the selection highlight, although I could also live with the background colour blocking the selection highlight in that cell as long as the selected row was still clearly identified.
Is there some incantation I can use to achieve this? Or is this a bug in GTK3?
I'm using GTK 3.24.1 on Fedora 29. The application is written in Haskell using the gi-gtk binding.
I am working on a SAPUI5 app in which we do not want to add custom css to. Currently we are displaying text in a form which does not have the same height and styling as the inputs.
I'd prefer to change the text to an input with a pre-filled value so everything in the form has consistent styling but I need to differentiate that this should be treated as text.
The easiest way to do this is to remove the border but I cannot find away of doing this without creating custom css.
I tried borderDesign="None" but this does not affect inputs.
I'm working on a PresentationML parser, and I'm trying to implement support for themes with regard to font color. I'm working with the SDK, and I've puzzled out this monster:
Slide.SlidePart.SlideLayoutPart.SlideMasterPart.SlideMaster.SlideMasterPart.ThemePart.Theme.ThemeElements.ColorScheme
But it's still not clear where I go to get the color for a run which hasn't had it's color otherwise specified. Any help on this would be greatly appreciated.
TIA.
UPDATE: After just wading through the xml, it looks like the monster call I posted above is probably the right one...it yields an element with a "val" attribute that matches the hex code I'm looking for. But it's not clear how I would resolve the particular scheme in the color map ("Light1" in this case). I'm about 75% of the way there, I think - if someone can help me with the logic to know which scheme applies to a run, I think that's what I need.
The free ebook Open XML Explained might give some insight to aid your understanding. Under the PresentationML section, Document Content Structure it talks about how Themes and Master Layouts are used to give default values:
page 86 - 2nd Paragraph:
DrawingML theming can be used to create default values for fonts, layouts, and other branding related data and allow it to be separated from the main body of the presentation. A theme is reusable across all the Open XML markup languages. Inside a PresentationML package various themes are in use. By default each individual master, slide-, note- and hand-out masters, references a separate theme part. The presentation itself also references a default theme to be used in the presentation. This default theme shared with the slide masters by referencing the same part inside the package.
So, in the theme1.xml of your presentations SlideMaster, you will find a theme definition which is used for the slide master and your presentation. The color name Light1, Dark1, etc map to 12 required colors in the Color Scheme of the Theme Element for each theme. See schema for details.
So in the Run, you see Light1, which maps to the number defined in the theme. If the author changes a Master Layout and/or Theme, the Light1 doesn't change in the run, but the value in the theme might and that is where you get the new value from.
On Page 121, the 12 colors are mentioned in Open XML Explained:
Inside the theme element you are required to create a themeElements node which holds all the theme's data. At this level you can also apply extra information or overrides on the existing information inside the theme elements. Theme elements are built up using a set of child nodes, each node identifying a specific data item such as the fonts or colors. The clrScheme element defines a list of colors. The list of themed colors is limited to items such as 'accent1', or 'visited link'. Each of these theme colors uses a separate XML element, where the node name identifies the theme color. Inside this element you make use of the coloring mechanism discussed earlier on coloring shapes using DrawingML. In the markup sample 157 there are two theme colors defined, the 'dark-1' and 'accent-1' colors. The markup sample is not complete. You are required to define value for all the twelve theme colors.
Hope this helps...
I'm preparing Eclipse editor where one of the tabs is a tree with some values. I'm using colors and font style to give more information for the user. E.g. when the user puts a value which is out of range then the font color is red, or when a value is non-default then the font has a bold style.
But the user has to move the selection to another cell to see if the color/style has changed or not. Is it possible to change the color/style of the selected cell in the JFace tree?
There are several ways to do this. The two most obvious are:
Add your own custom label provider. Example here.
Add a label decorator. Here is a older somewhat dated article.
It is not possible to change the colors via theming.