Importing 1022 colors into LiveCode gradient
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Importing 1022 colors into LiveCode gradient
Hi All,
I was testing the practical limits of importing svg gradients into LiveCode vector graphics and
have success importing a svg with 1022 gradients. (Look attached files)
But I want to know, How many colors could we add safely to a LiveCode gradient?
Which are the practical limits of this feature?
Thanks in advance,
Al
I was testing the practical limits of importing svg gradients into LiveCode vector graphics and
have success importing a svg with 1022 gradients. (Look attached files)
But I want to know, How many colors could we add safely to a LiveCode gradient?
Which are the practical limits of this feature?
Thanks in advance,
Al
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Importing 1022 colors into LiveCode gradient
Hi Alejandro,
when I look at the "ramp" of the fillgradient there are only 255 lines. I do not see 1022 lines.
And the graphic looks differently than the SVG you provided.
Kind regards
Bernd
when I look at the "ramp" of the fillgradient there are only 255 lines. I do not see 1022 lines.
And the graphic looks differently than the SVG you provided.
Kind regards
Bernd
Re: Importing 1022 colors into LiveCode gradient
My mistake
Effectively, your observation answers my question:
LiveCode gradient ramp have an artificial limit
of 255 colors.
Looks that LiveCode imports the correct sequence of first 234 colors
but after these 234 colors, it just choose one color after
every 3 or 4 colors in the ramp list.
Check the attached files with both color ramp lists.
By the way, Bernd, Hermann and Willhelm, all of you enjoy really impressive math skills.
Could you join your minds to solve a recognized problem of svg files?
The problems is about flatten (or applying) all transforms to every element
in a svg file (groups, rectangles, arcs, circles, paths, gradients,etc) and produce
a new svg that is visually identical to the original, but without any transforms.
What do you think?
Many, many thanks again for reviewing this post!
Al
Effectively, your observation answers my question:
LiveCode gradient ramp have an artificial limit
of 255 colors.
Looks that LiveCode imports the correct sequence of first 234 colors
but after these 234 colors, it just choose one color after
every 3 or 4 colors in the ramp list.
Check the attached files with both color ramp lists.
By the way, Bernd, Hermann and Willhelm, all of you enjoy really impressive math skills.
Could you join your minds to solve a recognized problem of svg files?
The problems is about flatten (or applying) all transforms to every element
in a svg file (groups, rectangles, arcs, circles, paths, gradients,etc) and produce
a new svg that is visually identical to the original, but without any transforms.
What do you think?
Many, many thanks again for reviewing this post!
Al
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Importing 1022 colors into LiveCode gradient
Hi Alejandro,
I see what LC does in you attached files. So it is a limitation of Livecode. But I don't see a real use case for more than 255 colors/points on the ramp. Unless you want to import a gradient with more than 255 colors/points on the ramp from a SVG file as you have no obvious or easy way to map those 1022 to 255 entries.
Is this for importing SVG files?
maybe this library for transforms in LC by MaxV is a beginning?
https://github.com/angerangel/LCR3D
I never worked with it but it should also work for 2D objects/graphics.
Kind regards
Bernd
I see what LC does in you attached files. So it is a limitation of Livecode. But I don't see a real use case for more than 255 colors/points on the ramp. Unless you want to import a gradient with more than 255 colors/points on the ramp from a SVG file as you have no obvious or easy way to map those 1022 to 255 entries.
Is this for importing SVG files?
assuming you want this to translate SVG information into points for graphics thenThe problems is about flatten (or applying) all transforms to every element
in a svg file (groups, rectangles, arcs, circles, paths, gradients,etc) and produce
a new svg that is visually identical to the original, but without any transforms.
maybe this library for transforms in LC by MaxV is a beginning?
https://github.com/angerangel/LCR3D
I never worked with it but it should also work for 2D objects/graphics.
Kind regards
Bernd
Re: Importing 1022 colors into LiveCode gradient
Hi Bernd,
but I could just show them within the Browser widget
to work with. It's not fortuitous that it took so long (almost a decade)
to became widely supported and used among browsers, design apps and designers:
http://blog.siliconpublishing.com/2015/ ... se-of-svg/
No, it's for creating SVG files within LiVeCode...Is this for importing SVG files?
but I could just show them within the Browser widget
Actually SVGL contains code for this task, but SVG format is very difficultassuming you want this to translate SVG information into points for graphics then
maybe this library for transforms in LC by MaxV is a beginning?
https://github.com/angerangel/LCR3D
I never worked with it but it should also work for 2D objects/graphics.
to work with. It's not fortuitous that it took so long (almost a decade)
to became widely supported and used among browsers, design apps and designers:
http://blog.siliconpublishing.com/2015/ ... se-of-svg/
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Importing 1022 colors into LiveCode gradient
Hi Alejandro,
there are plans to implement
https://github.com/memononen/nanosvg
in LCB
Mark Waddingham has a pull-request that I can not find currently which is not final yet. It stalled a year ago.
https://github.com/livecode/livecode/pull/3089
I think that should take care of many problems of rendering more complex SVGs in LCB
I don't think it is useful to develop a parsing system in LCB which would be a huge undertaking.
I just wait patiently
Kind regards
Bernd
there are plans to implement
https://github.com/memononen/nanosvg
in LCB
Mark Waddingham has a pull-request that I can not find currently which is not final yet. It stalled a year ago.
https://github.com/livecode/livecode/pull/3089
I think that should take care of many problems of rendering more complex SVGs in LCB
I don't think it is useful to develop a parsing system in LCB which would be a huge undertaking.
I just wait patiently
Kind regards
Bernd
Re: Importing 1022 colors into LiveCode gradient
Some months ago, I started and stopped working with
removing transforms from svg, because when I fixed the code
to import correctly a particular svg file, then it failed with
many others svg files...
Maybe there is another way of solving this, without creating
a code branch for every different type of svg file that
every application produce.
Al
removing transforms from svg, because when I fixed the code
to import correctly a particular svg file, then it failed with
many others svg files...
Maybe there is another way of solving this, without creating
a code branch for every different type of svg file that
every application produce.
Al
Re: Importing 1022 colors into LiveCode gradient
By the way, in this forum thread:
http://forums.livecode.com/phpBB2/viewt ... 11&t=28384
there is an example of converting a svg into a bitmap
using LiveCode browser widget.
Al
http://forums.livecode.com/phpBB2/viewt ... 11&t=28384
there is an example of converting a svg into a bitmap
using LiveCode browser widget.
Al