Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix border and opacity lightshadow #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pabloprogramador
Copy link

Overview

Issues Resolved

  • fixes #

API Changes

None

Platforms Affected

  • All
  • iOS
  • Android
  • UWP

Behavioral Changes

None

Testing Procedure

PR Checklist

  • Rebased on top of the target branch at time of PR
  • Changes adhere to coding standard

@felipebaltazar felipebaltazar self-requested a review May 5, 2020 11:31
@felipebaltazar
Copy link
Owner

felipebaltazar commented May 5, 2020

Teria como adicionar imagens do antes/depois, para documentar a alteração?

Obrigado pela contribuição!

Xamarin.Forms.NeoControls/NeoView.xaml.cs Outdated Show resolved Hide resolved
@@ -162,11 +164,13 @@ protected virtual void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEve
if (drawOuterShadow)
DrawOuterShadow(context);

SetPaintColor(context);
//SetPaintColor(context);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Porque precisou remover a busca pelo paint color?
Eu criei essa parte para garantir que a cor de Background seria aplicada no controle, pois como o paint é passado por referencia, muitas vezes alteramos alguns parametros.
Um exemplo disso é a NeoProgressView

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vou refazer alguns testes, achei que ele estava redundante, reaplicando o efeito duas vezes

Xamarin.Forms.NeoControls/NeoView.xaml.cs Outdated Show resolved Hide resolved
@@ -186,6 +190,8 @@ protected virtual void DrawInnerShadow(RenderContext context)
{
var fShadowDistance = Convert.ToSingle(ShadowDistance);
var darkShadow = Color.FromRgba(DarkShadowColor.R, DarkShadowColor.G, DarkShadowColor.B, Elevation);
var lightShadow = Color.FromRgba(LightShadowColor.R, LightShadowColor.G, LightShadowColor.B, Elevation);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interessante, imaginei que o light Shadow precisaria ser sempre solido, pois no neomorfismo temos esse efeito de "continuidade" entre o fundo e o controle. Porém, faz sentido alterar a "força" dessa sombra com relação à elevação.
Seria interessante uma imagem para visualizar o efeito com alteração dessa opacidade.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A verdade é que precisamos diferencia-la, porque caso o fundo seja estilo dark, precisamos de mais escuro e menos claro, e caso o fundo seja light, precisamos justamente do contrário, menos intensidade no preto, e mais intensidade no branco

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sim, mas para isso está aberta a possibilidade de alterar a cor, podendo utilizar um hexa decimal por exemplo.

O Elevation é a aplicação da opacidade em cima dessa cor ja definida, para dar ao programador uma ferramenta que possa utilizar nesse sentido. Criando efeitos de diferentes relevos ou animações.

Acredito que não seja o caso aplicado ao LightShadow

pabloprogramador and others added 2 commits May 5, 2020 12:40
Co-authored-by: Felipe Baltazar <felipe.dasilvabaltazar@gmail.com>
Co-authored-by: Felipe Baltazar <felipe.dasilvabaltazar@gmail.com>
@felipebaltazar felipebaltazar added the bug 🐛 Something isn't working label May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants