| 1 |
<?xml version="1.0" standalone="no"?> |
| 2 |
<!-- |
| 3 |
|
| 4 |
Licensed to the Apache Software Foundation (ASF) under one or more |
| 5 |
contributor license agreements. See the NOTICE file distributed with |
| 6 |
this work for additional information regarding copyright ownership. |
| 7 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
| 8 |
(the "License"); you may not use this file except in compliance with |
| 9 |
the License. You may obtain a copy of the License at |
| 10 |
|
| 11 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 12 |
|
| 13 |
Unless required by applicable law or agreed to in writing, software |
| 14 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 15 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 |
See the License for the specific language governing permissions and |
| 17 |
limitations under the License. |
| 18 |
|
| 19 |
--> |
| 20 |
<!-- ====================================================================== --> |
| 21 |
<!-- Test for the color functions introduced with SVG Color 1.2 --> |
| 22 |
<!-- http://www.w3.org/TR/SVGColor12 --> |
| 23 |
<!-- --> |
| 24 |
<!-- @version $Id$ --> |
| 25 |
<!-- ====================================================================== --> |
| 26 |
|
| 27 |
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?> |
| 28 |
|
| 29 |
<svg id="body" width="450" height="500" viewBox="0 0 450 500" |
| 30 |
xmlns="http://www.w3.org/2000/svg" version="1.2" |
| 31 |
xmlns:xlink="http://www.w3.org/1999/xlink" > |
| 32 |
|
| 33 |
<title>SVG Color 1.2 Test</title> |
| 34 |
|
| 35 |
<!-- ============================================================= --> |
| 36 |
<!-- Test content --> |
| 37 |
<!-- ============================================================= --> |
| 38 |
<defs> |
| 39 |
<color-profile name="MyNamedColors" xlink:href="file:ncp-example.icc" /> |
| 40 |
|
| 41 |
</defs> |
| 42 |
|
| 43 |
<g id="testContent" class="legend" style="text-anchor:middle"> |
| 44 |
<text x="225" y="40" class="title"> |
| 45 |
SVG Color 1.2 Functions (Calibrated Colors) |
| 46 |
</text> |
| 47 |
|
| 48 |
<g stroke="black" stroke-width="2" transform="translate(35, 90)"> |
| 49 |
|
| 50 |
<rect y="0" width="40" height="40" fill="#FF0000 icc-named-color(MyNamedColors, Postgelb)"/> |
| 51 |
|
| 52 |
<rect y="60" width="40" height="40" fill="#00FF00 icc-named-color(MissingProfile, SomeName)"/> |
| 53 |
|
| 54 |
<rect y="120" width="40" height="40" fill="#FF0000 cielab(83.25, 16.45, 96.89)"/> |
| 55 |
|
| 56 |
<rect y="180" width="40" height="40" fill="#FF0000 cielch(83.25, 98.28, 80.36)"/> |
| 57 |
|
| 58 |
</g> |
| 59 |
|
| 60 |
<!-- |
| 61 |
Unsupported color functions or missing profiles will result in the boxes appearing |
| 62 |
red meaning that the sRGB fallback was used. All but the second box of the four |
| 63 |
should be a darker yellow. |
| 64 |
--> |
| 65 |
|
| 66 |
<g text-anchor="start" transform="translate(90, 110)"> |
| 67 |
<text y="0"> |
| 68 |
<tspan>fill="#FF0000 icc-named-color(MyNamedColors, Postgelb)"</tspan> |
| 69 |
<tspan x="0" dy="12">Box should be yellow.</tspan> |
| 70 |
</text> |
| 71 |
<text y="60"> |
| 72 |
<tspan>fill="#00FF00 icc-named-color(MissingProfile, SomeName)"</tspan> |
| 73 |
<tspan x="0" dy="12">Box should be green.</tspan> |
| 74 |
</text> |
| 75 |
<text y="120"> |
| 76 |
<tspan>fill="#FF0000 cielab(83.25, 16.45, 96.89)"</tspan> |
| 77 |
<tspan x="0" dy="12">Box should be yellow.</tspan> |
| 78 |
</text> |
| 79 |
<text y="180"> |
| 80 |
<tspan>fill="#FF0000 cielch(83.25, 98.28, 80.36)"</tspan> |
| 81 |
<tspan x="0" dy="12">Box should be yellow.</tspan> |
| 82 |
</text> |
| 83 |
</g> |
| 84 |
|
| 85 |
<g transform="translate(25, 360)"> |
| 86 |
<defs> |
| 87 |
<linearGradient id="NCGradient"> |
| 88 |
<stop offset="10%" stop-color="#FF0000 icc-named-color(MyNamedColors, Postgelb)" /> |
| 89 |
<stop offset="90%" stop-color="#0000FF icc-named-color(MyNamedColors, MyRed)" /> |
| 90 |
</linearGradient> |
| 91 |
<filter id="MyFilter" filterUnits="userSpaceOnUse" x="-50" y="-50" width="200" height="120"> |
| 92 |
<feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur"/> |
| 93 |
<feOffset in="blur" dx="4" dy="4" result="offsetBlur"/> |
| 94 |
<feSpecularLighting in="blur" surfaceScale="5" specularConstant=".75" |
| 95 |
specularExponent="20" lighting-color="#bbbbbb" |
| 96 |
result="specOut"> |
| 97 |
<fePointLight x="-5000" y="-10000" z="20000"/> |
| 98 |
</feSpecularLighting> |
| 99 |
<feComposite in="specOut" in2="SourceAlpha" operator="in" result="specOut"/> |
| 100 |
<feComposite in="SourceGraphic" in2="specOut" operator="arithmetic" |
| 101 |
k1="0" k2="1" k3="1" k4="0" result="litPaint"/> |
| 102 |
<feMerge> |
| 103 |
<feMergeNode in="offsetBlur"/> |
| 104 |
<feMergeNode in="litPaint"/> |
| 105 |
</feMerge> |
| 106 |
</filter> |
| 107 |
</defs> |
| 108 |
<rect x="10" y="0" width="40" height="40" fill="#FF0000 icc-named-color(MyNamedColors, Postgelb)"/> |
| 109 |
<rect x="80" y="0" width="100" height="40" fill="url(#NCGradient)"/> |
| 110 |
<g filter="url(#MyFilter)" transform="translate(220, 0)"> |
| 111 |
<path d="M0,20 c20,-50 20,50 40,0 s20,50 40,0 s20,50 40,0" |
| 112 |
fill="none" stroke="#FF0000 icc-named-color(MyNamedColors, Postgelb)" stroke-width="12"/> |
| 113 |
</g> |
| 114 |
|
| 115 |
<rect x="0" y="30" width="400" height="20" fill="gray" opacity="0.4"/> |
| 116 |
|
| 117 |
</g> |
| 118 |
<text y="430"> |
| 119 |
<tspan x="225">Opacity test with fill, gradient and filter.</tspan> |
| 120 |
<tspan x="225" dy="12">Elements should be yellow, the gradient yellow to red.</tspan> |
| 121 |
</text> |
| 122 |
|
| 123 |
</g> |
| 124 |
|
| 125 |
<!-- ============================================================= --> |
| 126 |
<!-- Batik sample mark --> |
| 127 |
<!-- ============================================================= --> |
| 128 |
<use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" /> |
| 129 |
</svg> |