Comments (4)
https://www.w3.org/TR/2008/REC-CSS2-20080411/syndata.html#color-units
The format of an RGB value in hexadecimal notation is a '#' immediately followed by either three or six hexadecimal characters. The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00. This ensures that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies on the color depth of the display.
There is fill-opacity and stroke-opacity https://www.w3.org/TR/SVG11/painting.html
from svg.skia.
aarrggbb formats are valid in avalonia so this is the reason I was using that way. I can workaround removing that alpha channel before sending it to SVG.Skia.
The reason I reported it is because I'm previous SVG.Skia it worked fine.
from svg.skia.
aarrggbb formats are valid in avalonia so this is the reason I was using that way. I can workaround removing that alpha channel before sending it to SVG.Skia.
The reason I reported it is because I'm previous SVG.Skia it worked fine.
There have been many changes in the parsing code for Color and some issues with Microsoft deprecating System.Drawing cross-platform support so it might have changed. There are are some gray areas in svg standard compliance, not sure we can make it work here.
from svg.skia.
I place here my workaround for reference:
static string GetIconForegroundColor(ThemeBrushes.Name color)
{
ISolidColorBrush result = (ISolidColorBrush)ThemeBrushes.GetBrush(color);
return RemoveAlpha(result.Color.ToString());
}
static string RemoveAlpha(string hexColor)
{
// #aarrggb colors are not supported anymore in Svg.Skia
// so we need to remove the alpha part here
// https://github.com/wieslawsoltes/Svg.Skia/issues/118
if (hexColor.Length != 9 || !hexColor.ToLowerInvariant().StartsWith("#ff"))
return hexColor;
return stackalloc char[]
{
'#',
hexColor[3], hexColor[4],
hexColor[5], hexColor[6],
hexColor[7], hexColor[8]
}.ToString();
}
from svg.skia.
Related Issues (20)
- Crashing in Xamarin Forms HOT 2
- Svg to Png - text vertical alignment (dominant-baseline) not implemented/working HOT 2
- Shadows and gradients are not drawn correctly HOT 2
- Filter with feColorMatrix computed incorrectly
- A readme submodules HOT 1
- Support for Avalonia v10.1.19 HOT 3
- Unable to convert SVG string HOT 1
- Can't render SVG from internet with Avalonia Web HOT 1
- Method 'Render' in type SvgCustomDrawOperation does not have an implementation HOT 3
- Fizzler depenency not MIT HOT 2
- Problems running the dotnet tool without .NET Core 3.1 available
- Can't display custom font when converting SVG to PDF HOT 1
- Cannot render text SVG which is one of W3C samples HOT 1
- SvgImage markupextension cannot support nested binding extension HOT 2
- Styling support for SVG HOT 8
- SVG with some pathes are not drawn HOT 2
- Compile error after update - There is no argument given that corresponds to the required parameter 'skiaModel' of 'SKSvg.ToPicture(SvgFragment, SkiaModel, IAssetLoader)' HOT 1
- Why isn't this SVG image showing? HOT 1
- SvgExtensions.Transforms.GetDimensions rounding causes loss of precision HOT 1
- Publish a new version of Svg.Skia.Converter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svg.skia.