Skip to content

Commit

Permalink
patch for hextorgb
Browse files Browse the repository at this point in the history
  • Loading branch information
SymbolixAU committed Aug 14, 2018
1 parent 0f3bb95 commit f16fa9c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mapdeck
Type: Package
Title: Interactive Maps Using 'Mapbox GL JS' and 'Deck.gl'
Version: 0.1.0
Version: 0.1.1
Date: 2018-08-11
Authors@R: c(
person("David", "Cooley", ,"dcooley@symbolix.com.au", role = c("aut", "cre"))
Expand Down
2 changes: 1 addition & 1 deletion inst/htmlwidgets/lib/polygon/polygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function add_polygon( map_id, polygon_data, layer_id, light_settings ) {
extruded: true,
lineWidthMinPixels: 1,
getPolygon: d => decode_polygons( d.polyline ),
getLineColor: d => hexToRgb( d.stroke_colour ),
getLineColor: d => hexToRgb_simple( d.stroke_colour ),
getFillColor: d => hexToRGBA( d.fill_colour, d.fill_opacity ),
getLineWidth: d => d.stroke_width,
getElevation: d => d.elevation,
Expand Down
4 changes: 2 additions & 2 deletions inst/htmlwidgets/mapdeck.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function update_layer( map_id, layer_id, layer ) {
*
* Converts hex colours to rgb
*/
const hexToRgb = hex =>
const hexToRgb_simple = hex =>
hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i
,(m, r, g, b) => '#' + r + r + g + g + b + b)
.substring(1).match(/.{2}/g)
Expand All @@ -197,7 +197,7 @@ function to_rgb( colour_range ) {
n = colour_range.length;

for (i = 0; i < n; i++) {
arr.push( hexToRgb( colour_range[i]) );
arr.push( hexToRgb_simple( colour_range[i]) );
}
return arr;
}
Expand Down

0 comments on commit f16fa9c

Please sign in to comment.