Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

HARP-7517: Partial support for rgba[..] and "rgba(..)" expressions in style. #1010

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

kkostecki
Copy link
Contributor

Gives compatibility for themes using 4 channel colors in styling with
attributes expressions like:

  • color: rgba[255, 255, 255, 0.5]
  • backgroundColor: "rgba(255, 255, 255, 0.5)"

Although those styling attributes will be parsed and read, the alpha
channel component will be silently ignored. Full support for alpha channel
need to be implemented.

TODO:

  • support RGBA/ARGB colors internally in engine,
  • alpha channel mapping to THREE.js opacity and transparent material
    properties,
  • support four channel color interpolation,
  • more unit tests.

Signed-off-by: Krystian Kostecki ext-krystian.kostecki@here.com

Thank you for contributing to harp.gl!

Before requesting a pull request, please remember to check the following documents:

If you are adding new functionality we would highly appreciate if you can describe what is the capability you are adding and even better if you can add some examples. Please also remember to add tests for it.

CI Check

Our bots will check whether your PR can be directly integrated into the mainline. We have some internal integration tests running on the background, our bots will inform you of the next steps and someone from our team will take a look and help if needed!

And please do not forget to sign-off your commit! You can read more about DCO here. But, in short, you just need to use git commit -s or append --signoff when you are committing to the repo.

Happy contributing!

@heremaps-bot
Copy link
Collaborator

Can one of the admins verify this patch?

robertoraggi
robertoraggi previously approved these changes Nov 6, 2019
… theme.

Gives compatibility for themes using 4 channel colors in styling with
attributes expressions like:
- color: rgba[255, 255, 255, 0.5]
- backgroundColor: "rgba(255, 255, 255, 0.5)"

Although those styling attributes will be parsed and read, the alpha
channel component will be silently ignored. Full support for alpha channel
needs to be implemented.

TODO:
- support RGBA/ARGB colors internally in HARP engine,
- alpha channel mapping to THREE.js opacity and transparent material
properties,
- four channels color interpolation,
- additional unit tests covering different alpha value scenarios.

Signed-off-by: Krystian Kostecki <ext-krystian.kostecki@here.com>
@codecov-io
Copy link

codecov-io commented Nov 7, 2019

Codecov Report

Merging #1010 into master will increase coverage by 0.14%.
The diff coverage is 89.58%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1010      +/-   ##
==========================================
+ Coverage   45.12%   45.27%   +0.14%     
==========================================
  Files         236      249      +13     
  Lines       22112    22351     +239     
  Branches     5025     5071      +46     
==========================================
+ Hits         9978    10119     +141     
- Misses      12134    12232      +98
Impacted Files Coverage Δ
...atasource-protocol/lib/operators/ColorOperators.ts 100% <100%> (ø) ⬆️
@here/harp-mapview/lib/DecodedTileHelpers.ts 44.54% <100%> (+0.9%) ⬆️
...rp-datasource-protocol/lib/StringEncodedNumeral.ts 57.14% <33.33%> (-4.93%) ⬇️
...rp-datasource-protocol/lib/InterpolatedProperty.ts 72.29% <66.66%> (-0.31%) ⬇️
@here/harp-materials/lib/Utils.ts 20% <0%> (-80%) ⬇️
@here/harp-materials/lib/IconMaterial.ts 44.44% <0%> (-55.56%) ⬇️
@here/harp-map-controls/lib/Utils.ts 46.15% <0%> (-23.85%) ⬇️
@here/harp-omv-datasource/lib/OmvTiler.ts 50% <0%> (-16.67%) ⬇️
@here/harp-utils/lib/ObjectUtils.ts 83.33% <0%> (-10.22%) ⬇️
@here/harp-utils/lib/UrlResolver.ts 91.66% <0%> (-8.34%) ⬇️
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6247cec...a0d3701. Read the comment docs.

@kkostecki kkostecki merged commit 08e90ba into master Nov 7, 2019
@kkostecki kkostecki deleted the harp-7517-rgba-expression branch November 7, 2019 10:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants