Skip to content

Commit e6eb946

Browse files
committed
dwins#31, Color names should be evaluated in a case insensitive manner
1 parent 44714ab commit e6eb946

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

geocss/src/main/scala/org/geoscript/geocss/CssOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ object CssOps {
330330
val chars = hex.flatMap(Seq.fill(2)(_)).mkString("#", "", "")
331331
Some(filters.literal(chars))
332332
case Literal(name) =>
333-
colors.get(name).map(filters.literal(_))
333+
colors.get(name.toLowerCase).map(filters.literal(_))
334334
case v =>
335335
valueToExpression(v)
336336
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* {
2+
fill: IndianRed;
3+
}

geocss/src/test/scala/org/geoscript/geocss/SLDTest.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,12 @@ class SLDTest extends FunSuite with ShouldMatchers {
354354
val fontFill = css2sld2dom("/font-fill.css")
355355
(fontFill \\ "GraphicFill") should have(size(0))
356356
}
357+
358+
test("Colors are interpreted in case insensitive manner") {
359+
val labels = css2sld2dom("/colorname.css")
360+
val cssParameter = labels \\ "PolygonSymbolizer" \\ "Fill" \\ "CssParameter"
361+
cssParameter.text should equal("#cd5c5c")
362+
}
357363

358364
test("Everything should convert without throwing Exceptions") {
359365
val testData = Seq(

0 commit comments

Comments
 (0)