mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-12 03:04:51 -04:00
--User changes
-Add Summary tab to the info dock, place existing bounds related info in a new Bounds tab. -Add a toolbar with the most common actions on it. -Remove old toolbar at the top of the library tab. --Code changes -Refactor code to make a color visible on a background into VisibleColor() in FractoriumCommon.h -Add IsXformLinked() to determine if an xform is linked to another. -Remove SetPaletteRefTable() and GetQRgbFromPaletteIndex() from FractoriumEmberControllerBase and its derivations, unused. -Add FillSummary() to FractoriumEmberController. Call in Update(), UpdateXform() and other places where values are changed to force an update of the summary view. -Add export statements to FractoriumInfo.cpp. -Remove image parameter from SetPaletteTableItem(), it was a bad design. -InitToolbarUI() is now empty since toolbar initialization happens automatically. Leave as a placeholder. -Refactor code to get a palette color at a given index and convert it to a QColor to ColorIndexToQColor().
This commit is contained in:
@ -183,13 +183,7 @@ void FractoriumEmberController<T>::BackgroundChanged(const QColor& color)
|
||||
QString g = ToString(color.green());
|
||||
QString b = ToString(color.blue());
|
||||
|
||||
int threshold = 105;
|
||||
int delta = (color.red() * 0.299) + //Magic numbers gotten from a Stack Overflow post.
|
||||
(color.green() * 0.587) +
|
||||
(color.blue() * 0.114);
|
||||
|
||||
QColor textColor = (255 - delta < threshold) ? QColor(0, 0, 0) : QColor(255, 255, 255);
|
||||
colorTable->item(itemRow, 1)->setTextColor(textColor);
|
||||
colorTable->item(itemRow, 1)->setTextColor(VisibleColor(color));
|
||||
colorTable->item(itemRow, 1)->setText("rgb(" + r + ", " + g + ", " + b + ")");
|
||||
|
||||
//Color is 0-255, normalize to 0-1.
|
||||
|
Reference in New Issue
Block a user