Skip to content

Commit

Permalink
Merge pull request #25 from arceusVen1/partycolor_mixing
Browse files Browse the repository at this point in the history
partycolor_mixing
  • Loading branch information
arceusVen1 authored May 9, 2024
2 parents d8d23da + d049026 commit 3f4b66f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions lib/classes/texture.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ class ModelTexture {
}

if (attribute.usePlayerColor && partyColor != null && p.a != 0) {
p.r = partyColor.red;
p.g = partyColor.green;
p.b = partyColor.blue;
p.r = (p.r * partyColor.red)/255;
p.g = (p.g * partyColor.green)/255;
p.b = (p.b * partyColor.blue)/255;
}
// required because of bug in flutter whre alpha 0 with color isn't treated as fully trasnaprent

// required because of bug in flutter where alpha 0 with color isn't treated as fully transparent
if (p.a == 0) {
p.r = 0;
p.g = 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/viewer/viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class ModelViewerLoader extends ConsumerWidget {
.toModel(materialsTable, pwFolder, detailTable, getTexturePathFnct);
return FutureBuilder(
future: model.loadTextures(Theme.of(context).colorScheme.onBackground,
showPartyColor ? Colors.cyan : null),
showPartyColor ? Color(0xffffab01) : null),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return Viewer(
Expand Down

0 comments on commit 3f4b66f

Please sign in to comment.