A group of new effects in the Text submenu performs various case conversions on selected text objects: converting to UPPERCASE, lowercase, Sentence case, Title Case, as well as flipping case (switching uppercase to lowercase and back) and rANdoMiZInG cAse.
Just another idea to drive those heroic programmers of Inkscape mad, but I think it could be implemented by anyone knowing only slightly more about programming as I do:
If I had a drawing with 3 colors, I'd like a function/widget/thingy/batch-msdos-bash-script that 1. can substitute all ocurances of 1 color for 1 predifinded other color. (so, for example, I could tell it to substitue all #000000 -> #FF0000, #FF0000 -> #FFFFFF and #FFFF00 -> #0000FF, hence turning the German flag into the Dutch) 2. can either systematiccally cycle/iterate through the specified colors, or assing them randomly, creating a series of output SVG files, all with different color-schemes.
In this way, it would be easy to test quickly different color-scheme's on a drawing. Make it first in 3 greys, and then test it with vibrant, saturated colors or with dim, purple shades of green...
I'm curious about your comments!
Maarten
********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager.
This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses.
www.powel.no **********************************************************************
On Tuesday, July 10, 2007, 9:10:26 AM, Maarten wrote:
MvdV> Just another idea to drive those heroic programmers of Inkscape mad, but MvdV> I think it could be implemented by anyone knowing only slightly more MvdV> about programming as I do:
MvdV> If I had a drawing with 3 colors, I'd like a MvdV> function/widget/thingy/batch-msdos-bash-script that MvdV> 1. can substitute all ocurances of 1 color for 1 predifinded other MvdV> color. MvdV> (so, for example, I could tell it to substitue all MvdV> #000000 -> #FF0000, MvdV> #FF0000 -> #FFFFFF and MvdV> #FFFF00 -> #0000FF, MvdV> hence turning the German flag into the Dutch)
The trouble with search-and replace is that it can clobber values that accidentally clash, if the substitutions are performed sequentially. In your example you turn black to red; and then red to green (so everything that was black or red originally becomes green).
And you probably don't want to turn *all * values that happen to use a given color into a different one; just the ones that you specify.
MvdV> 2. can either systematiccally cycle/iterate through the specified MvdV> colors, or assing them randomly, creating a series of output SVG files, MvdV> all with different color-schemes.
MvdV> In this way, it would be easy to test quickly different color-scheme's MvdV> on a drawing. Make it first in 3 greys, and then test it with vibrant, MvdV> saturated colors or with dim, purple shades of green...
MvdV> I'm curious about your comments!
This is already possible and requires no scripting. Instead of setting colors directly, set classes and then use CSS to set the colors. Thus
<svg xmlns:svg="http://www.w3.org/2000/svg" viewBox -10 -10 170 120"> <rect class="left" x="0" y="0" width="50" height="100"/> <rect class="middle" x="50" y="0" width="50" height="100"/> <rect class="right" x="1000" y="0" width="50" height="100"/> </svg>
german-flag.css .left {fill: #000} .middle {fill: #f00} .right {fill: #ff0}
dutch-flag.css .left {fill: #f00} .middle {fill: #fff} .right {fill: #00f}
Bringing this back to Inkscape, which can already assign classes to elements; a UI to select a stylesheet and a UI to generate color schemes (== classes and fill colors) using things like complementary colors, triads, darker/lighter less/more saturated and so on might be useful. CSS can't do that sort of color computation, but a authoring tool can.
On 2007-July-10 , at 09:10 , Maarten van der Velde wrote:
Just another idea to drive those heroic programmers of Inkscape mad, but I think it could be implemented by anyone knowing only slightly more about programming as I do:
If I had a drawing with 3 colors, I'd like a function/widget/thingy/batch-msdos-bash-script that
- can substitute all ocurances of 1 color for 1 predifinded other
color. (so, for example, I could tell it to substitue all #000000 -> #FF0000, #FF0000 -> #FFFFFF and #FFFF00 -> #0000FF, hence turning the German flag into the Dutch) 2. can either systematiccally cycle/iterate through the specified colors, or assing them randomly, creating a series of output SVG files, all with different color-schemes.
In this way, it would be easy to test quickly different color-scheme's on a drawing. Make it first in 3 greys, and then test it with vibrant, saturated colors or with dim, purple shades of green...
This kind of extension was already mentioned once on the devel list, in a discussion about some features similar to the "live trace" feature of Adobe Illustrator. See this message for example: http://thread.gmane.org/gmane.comp.graphics.inkscape.user/8162/ focus=8172 The point was to be general: take any object/group of objects/ selection and change the colors in it to fit the currently selected swatches. I think that this + easier access to swatches (with the possibility to create a new palette on the fly and such) would be a really great feature. Applying a color scheme to a drawing would then be a breeze. Volunteers?
JiHO --- http://jo.irisson.free.fr/
On 7/10/07, Maarten van der Velde <Maarten.van-der-Velde@...2171...> wrote:
- can substitute all ocurances of 1 color for 1 predifinded other
color. (so, for example, I could tell it to substitue all #000000 -> #FF0000, #FF0000 -> #FFFFFF and #FFFF00 -> #0000FF, hence turning the German flag into the Dutch)
With our coloreffect.py extension class, it's very easy to implement. I just did it.
* A new effect, Replace color in the Color submenu, simply replaces one RRGGBB-specified color to another within selection or, if there's no selection, in the entire document. As with other effects in that submenu, the replacement affects fill, stroke, and gradient colors, but not colors of bitmaps.
- can either systematiccally cycle/iterate through the specified
colors, or assing them randomly, creating a series of output SVG files, all with different color-schemes.
Anyone can easily do this using the same extension base class, patches are welcome :)
Ted:
* A new effect, Replace color in the Color submenu, simply
replaces one RRGGBB-specified color to another within selection or, if there's no selection, in the entire document. As with other effects in that submenu, the replacement affects fill, stroke, and gradient colors, but not colors of bitmaps.
And this is an example of an effect where the "live preview" checkbox is an absolute necessity. Without it, it tries to update on any change in the color fields, so before you can see the replacement you want, you are forced to observe a whole series of weird, wrong, and incomplete replacements in your document - which is INCREDIBLY annoying. I think it's a perfect use case demonstrating that this checkbox must be there and it must be off by default.
And while at it, I also added a Replace effect for text which allows you to replace one string by another, globally or in selected text objects.
On 7/10/07, bulia byak <buliabyak@...155...> wrote:
On 7/10/07, Maarten van der Velde <Maarten.van-der-Velde@...2171...> wrote:
- can substitute all ocurances of 1 color for 1 predifinded other
color. (so, for example, I could tell it to substitue all #000000 -> #FF0000, #FF0000 -> #FFFFFF and #FFFF00 -> #0000FF, hence turning the German flag into the Dutch)
With our coloreffect.py extension class, it's very easy to implement. I just did it.
* A new effect, Replace color in the Color submenu, simply
replaces one RRGGBB-specified color to another within selection or, if there's no selection, in the entire document. As with other effects in that submenu, the replacement affects fill, stroke, and gradient colors, but not colors of bitmaps.
- can either systematiccally cycle/iterate through the specified
colors, or assing them randomly, creating a series of output SVG files, all with different color-schemes.
Anyone can easily do this using the same extension base class, patches are welcome :)
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org
If I had a drawing with 3 colors, I'd like a function/widget/thingy/batch-msdos-bash-script that
- can substitute all ocurances of 1 color for 1 predifinded other
color. (so, for example, I could tell it to substitue all #000000 -> #FF0000, #FF0000 -> #FFFFFF and #FFFF00 -> #0000FF,
Implementing css in inkscape would be nice and archives an similar effect. You could create named colors and other styles (classes) and apply them to objects. If you change the class all objects using this class get changed. I think all of you who know css (from html probably) know what i mean 0:-)
Florian
On Tue, 10 Jul 2007, Florian Ludwig wrote:
Implementing css in inkscape would be nice and archives an similar
The development version seems to support it right now, although it looks like you have to Save and Revert to get it to notice changes. Useful to know though.
Cheers -Terry
On Tuesday, July 10, 2007, 8:24:04 AM, bulia wrote:
bb> A group of new effects in the Text submenu performs various case bb> conversions on selected text objects: converting to UPPERCASE, bb> lowercase, Sentence case, Title Case, as well as flipping case bb> (switching uppercase to lowercase and back) and rANdoMiZInG cAse.
grEAt! What, no option to replace letters with numbers :)
<text xml:lang="en-leetspk"> Inkscape is teh roXXors 4 Xtr3m l337 H4X0rs. </text>
Switching to serious mode - does the case folding depend on locale? #include i18n-geek-question "what about turkish dotless I"
On 7/10/07, Chris Lilley <chris@...214...> wrote:
grEAt! What, no option to replace letters with numbers :)
Actually there's now a class, chardataeffect.py, which does all the grunt work of traversing the tree of text elements and passing all chardata bits in proper order as well as the newline and newpar flags to the process_chardata method. So you can create a new text effect very easily, just by providing your own process_chardata in a derived class.
Switching to serious mode - does the case folding depend on locale?
Python documentation claims that it does. I didn't test - but I just used Python's standard lower() and upper() methods.
participants (6)
-
bulia byak
-
Chris Lilley
-
Florian Ludwig
-
jiho
-
Maarten van der Velde
-
Terry Brown