Skip to content

Commit

Permalink
Traktor: Show palette in theme editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
apistol78 committed Jun 3, 2024
1 parent 4f8330c commit b9b0a37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 2 additions & 0 deletions code/Ui/StyleSheet.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ class T_DLLCLASS StyleSheet : public ISerializable

AlignedVector< Entity >& getEntities() { return m_entities; }

const AlignedVector< Color4ub >& getPalette() const { return m_palette; }

const AlignedVector< Entity >& getEntities() const { return m_entities; }

const SmallMap< std::wstring, std::wstring >& getValues() const { return m_values; }
Expand Down
9 changes: 1 addition & 8 deletions code/Ui/Theme/App/ThemeForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,7 @@ void ThemeForm::updatePalette()
if (!m_styleSheet)
return;

SmallSet< Color4ub > palette;
for (const auto& entity : m_styleSheet->getEntities())
{
for (auto it : entity.colors)
palette.insert(m_styleSheet->getColor(it.second));
}

for (const auto& color : palette)
for (const auto& color : m_styleSheet->getPalette())
{
Ref< drawing::Image > imageColor = new drawing::Image(drawing::PixelFormat::getR8G8B8A8(), 16, 16);
imageColor->clear(Color4f::fromColor4ub(color).rgb1());
Expand Down

0 comments on commit b9b0a37

Please sign in to comment.