diff --git a/apps/calculation/additional_outputs/complex_graph_cell.cpp b/apps/calculation/additional_outputs/complex_graph_cell.cpp index bc8a687b3..3bd48645d 100644 --- a/apps/calculation/additional_outputs/complex_graph_cell.cpp +++ b/apps/calculation/additional_outputs/complex_graph_cell.cpp @@ -25,7 +25,7 @@ void ComplexGraphView::drawRect(KDContext * ctx, KDRect rect) const { assert(!std::isnan(real) && !std::isnan(imag) && !std::isinf(real) && !std::isinf(imag)); // Draw the segment from the origin to the dot (real, imag) - drawSegment(ctx, rect, 0.0f, 0.0f, m_complex->real(), m_complex->imag(), Palette::GreyDark, false); + drawSegment(ctx, rect, 0.0f, 0.0f, m_complex->real(), m_complex->imag(), Palette::GrayDark, false); /* Draw the partial ellipse indicating the angle θ * - the ellipse parameters are a = |real|/5 and b = |imag|/5, @@ -58,7 +58,7 @@ void ComplexGraphView::drawRect(KDContext * ctx, KDRect rect) const { float a = parameters.real(); float b = parameters.imag(); return Poincare::Coordinate2D(a*std::cos(t*th), b*std::sin(t*th)); - }, ¶meters, &th, false, Palette::GreyDark, false); + }, ¶meters, &th, false, Palette::GrayDark, false); // Draw dashed segment to indicate real and imaginary drawHorizontalOrVerticalSegment(ctx, rect, Axis::Vertical, real, 0.0f, imag, Palette::Red, 1, 3); diff --git a/apps/calculation/additional_outputs/illustration_cell.cpp b/apps/calculation/additional_outputs/illustration_cell.cpp index bd2471710..eb61b037b 100644 --- a/apps/calculation/additional_outputs/illustration_cell.cpp +++ b/apps/calculation/additional_outputs/illustration_cell.cpp @@ -10,7 +10,7 @@ void IllustrationCell::layoutSubviews(bool force) { } void IllustrationCell::drawRect(KDContext * ctx, KDRect rect) const { - drawBorderOfRect(ctx, bounds(), Palette::GreyBright); + drawBorderOfRect(ctx, bounds(), Palette::GrayBright); } } diff --git a/apps/calculation/additional_outputs/trigonometry_graph_cell.cpp b/apps/calculation/additional_outputs/trigonometry_graph_cell.cpp index f28c107f4..903674ce5 100644 --- a/apps/calculation/additional_outputs/trigonometry_graph_cell.cpp +++ b/apps/calculation/additional_outputs/trigonometry_graph_cell.cpp @@ -20,7 +20,7 @@ void TrigonometryGraphView::drawRect(KDContext * ctx, KDRect rect) const { // Draw the circle drawCurve(ctx, rect, 0.0f, 2.0f*M_PI, M_PI/180.0f, [](float t, void * model, void * context) { return Poincare::Coordinate2D(std::cos(t), std::sin(t)); - }, nullptr, nullptr, true, Palette::GreyDark, false); + }, nullptr, nullptr, true, Palette::GrayDark, false); // Draw dashed segment to indicate sine and cosine drawHorizontalOrVerticalSegment(ctx, rect, Axis::Vertical, c, 0.0f, s, Palette::Red, 1, 3); drawHorizontalOrVerticalSegment(ctx, rect, Axis::Horizontal, s, 0.0f, c, Palette::Red, 1, 3); diff --git a/apps/code/app.cpp b/apps/code/app.cpp index 3a54ba988..5ed4e204b 100644 --- a/apps/code/app.cpp +++ b/apps/code/app.cpp @@ -80,7 +80,7 @@ App::App(Snapshot * snapshot) : , snapshot->lockOnConsole() #endif ), - m_listFooter(&m_codeStackViewController, &m_menuController, &m_menuController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGrey, ButtonRowController::Size::Large), + m_listFooter(&m_codeStackViewController, &m_menuController, &m_menuController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGray, ButtonRowController::Size::Large), m_menuController(&m_listFooter, this, snapshot->scriptStore(), &m_listFooter), m_codeStackViewController(&m_modalViewController, &m_listFooter), m_variableBoxController(snapshot->scriptStore()) diff --git a/apps/code/catalog.de.i18n b/apps/code/catalog.de.i18n index 465fc8a06..71fa1de14 100644 --- a/apps/code/catalog.de.i18n +++ b/apps/code/catalog.de.i18n @@ -31,7 +31,7 @@ PythonColorBlack = "Black color" PythonColorBlue = "Blue color" PythonColorBrown = "Brown color" PythonColorGreen = "Green color" -PythonColorGrey = "Grey color" +PythonColorGray = "Gray color" PythonColorOrange = "Orange color" PythonColorPink = "Pink color" PythonColorPurple = "Purple color" diff --git a/apps/code/catalog.en.i18n b/apps/code/catalog.en.i18n index e158cda8b..0b015a929 100644 --- a/apps/code/catalog.en.i18n +++ b/apps/code/catalog.en.i18n @@ -31,7 +31,7 @@ PythonColorBlack = "Black color" PythonColorBlue = "Blue color" PythonColorBrown = "Brown color" PythonColorGreen = "Green color" -PythonColorGrey = "Grey color" +PythonColorGray = "Gray color" PythonColorOrange = "Orange color" PythonColorPink = "Pink color" PythonColorPurple = "Purple color" diff --git a/apps/code/catalog.es.i18n b/apps/code/catalog.es.i18n index 8503f7ed7..c474c30d6 100644 --- a/apps/code/catalog.es.i18n +++ b/apps/code/catalog.es.i18n @@ -31,7 +31,7 @@ PythonColorBlack = "Black color" PythonColorBlue = "Blue color" PythonColorBrown = "Brown color" PythonColorGreen = "Green color" -PythonColorGrey = "Grey color" +PythonColorGray = "Gray color" PythonColorOrange = "Orange color" PythonColorPink = "Pink color" PythonColorPurple = "Purple color" diff --git a/apps/code/catalog.fr.i18n b/apps/code/catalog.fr.i18n index 8a263636c..20ccfe09e 100644 --- a/apps/code/catalog.fr.i18n +++ b/apps/code/catalog.fr.i18n @@ -31,7 +31,7 @@ PythonColorBlack = "Couleur noire" PythonColorBlue = "Couleur bleue" PythonColorBrown = "Couleur marron" PythonColorGreen = "Couleur verte" -PythonColorGrey = "Couleur grise" +PythonColorGray = "Couleur grise" PythonColorOrange = "Couleur orange" PythonColorPink = "Couleur rose" PythonColorPurple = "Couleur violette" diff --git a/apps/code/catalog.it.i18n b/apps/code/catalog.it.i18n index 893feb525..ae8b928fa 100644 --- a/apps/code/catalog.it.i18n +++ b/apps/code/catalog.it.i18n @@ -31,7 +31,7 @@ PythonColorBlack = "Colore nero" PythonColorBlue = "Colore blu" PythonColorBrown = "Colore marrone" PythonColorGreen = "Colore verde" -PythonColorGrey = "Colore grigio" +PythonColorGray = "Colore grigio" PythonColorOrange = "Colore arancione" PythonColorPink = "Colore rosa" PythonColorPurple = "Colore viola" diff --git a/apps/code/catalog.nl.i18n b/apps/code/catalog.nl.i18n index 843d9b3ab..ae344f98f 100644 --- a/apps/code/catalog.nl.i18n +++ b/apps/code/catalog.nl.i18n @@ -31,7 +31,7 @@ PythonColorBlack = "Zwarte kleur" PythonColorBlue = "Blauwe kleur" PythonColorBrown = "Bruine kleur" PythonColorGreen = "Groene kleur" -PythonColorGrey = "Grijze kleur" +PythonColorGray = "Grijze kleur" PythonColorOrange = "Oranje kleur" PythonColorPink = "Roze kleur" PythonColorPurple = "Paarse kleur" diff --git a/apps/code/catalog.pt.i18n b/apps/code/catalog.pt.i18n index 7d11881ef..b5b807535 100644 --- a/apps/code/catalog.pt.i18n +++ b/apps/code/catalog.pt.i18n @@ -31,7 +31,7 @@ PythonColorBlack = "Cor preta" PythonColorBlue = "Cor azul" PythonColorBrown = "Cor castanha" PythonColorGreen = "Cor verde" -PythonColorGrey = "Cor cinzenta" +PythonColorGray = "Cor cinzenta" PythonColorOrange = "Cor laranja" PythonColorPink = "Cor rosa" PythonColorPurple = "Cor roxa" diff --git a/apps/code/catalog.universal.i18n b/apps/code/catalog.universal.i18n index f6910c4ed..c1c68373b 100644 --- a/apps/code/catalog.universal.i18n +++ b/apps/code/catalog.universal.i18n @@ -33,7 +33,7 @@ PythonCommandColorBlack = "'black'" PythonCommandColorBlue = "'blue'" PythonCommandColorBrown = "'brown'" PythonCommandColorGreen = "'green'" -PythonCommandColorGrey = "'grey'" +PythonCommandColorGray = "'gray'" PythonCommandColorOrange = "'orange'" PythonCommandColorPink = "'pink'" PythonCommandColorPurple = "'purple'" diff --git a/apps/code/console_line_cell.h b/apps/code/console_line_cell.h index 8a740b913..fc49f6187 100644 --- a/apps/code/console_line_cell.h +++ b/apps/code/console_line_cell.h @@ -53,7 +53,7 @@ private: ConsoleLineView m_consoleLineView; }; static KDColor textColor(ConsoleLine * line) { - return line->isFromCurrentSession() ? KDColorBlack : Palette::GreyDark; + return line->isFromCurrentSession() ? KDColorBlack : Palette::GrayDark; } MessageTextView m_promptView; ScrollableConsoleLineView m_scrollableView; diff --git a/apps/code/editor_view.cpp b/apps/code/editor_view.cpp index 0af73b613..86a29ba66 100644 --- a/apps/code/editor_view.cpp +++ b/apps/code/editor_view.cpp @@ -57,7 +57,7 @@ void EditorView::layoutSubviews(bool force) { /* EditorView::GutterView */ void EditorView::GutterView::drawRect(KDContext * ctx, KDRect rect) const { - KDColor textColor = Palette::BlueishGrey; + KDColor textColor = Palette::BlueishGray; KDColor backgroundColor = KDColor::RGB24(0xE4E6E7); ctx->fillRect(rect, backgroundColor); diff --git a/apps/code/python_toolbox.cpp b/apps/code/python_toolbox.cpp index aecd3bfbc..3f8b21d6b 100644 --- a/apps/code/python_toolbox.cpp +++ b/apps/code/python_toolbox.cpp @@ -131,7 +131,7 @@ const ToolboxMessageTree MatplotlibPyplotModuleChildren[] = { ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorPink, I18n::Message::PythonColorPink, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorOrange, I18n::Message::PythonColorOrange, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorPurple, I18n::Message::PythonColorPurple, false), - ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorGrey, I18n::Message::PythonColorGrey, false) + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorGray, I18n::Message::PythonColorGray, false) }; const ToolboxMessageTree TurtleModuleChildren[] = { @@ -168,7 +168,7 @@ const ToolboxMessageTree TurtleModuleChildren[] = { ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorPink, I18n::Message::PythonColorPink, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorOrange, I18n::Message::PythonColorOrange, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorPurple, I18n::Message::PythonColorPurple, false), - ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorGrey, I18n::Message::PythonColorGrey, false) + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorGray, I18n::Message::PythonColorGray, false) }; const ToolboxMessageTree RandomModuleChildren[] = { @@ -332,7 +332,7 @@ const ToolboxMessageTree catalogChildren[] = { ToolboxMessageTree::Leaf(I18n::Message::PythonCommandGetrandbits, I18n::Message::PythonGetrandbits), ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandGoto, I18n::Message::PythonTurtleGoto), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorGreen, I18n::Message::PythonColorGreen, false), - ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorGrey, I18n::Message::PythonColorGrey, false), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorGray, I18n::Message::PythonColorGray, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandGrid, I18n::Message::PythonGrid), ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandHeading, I18n::Message::PythonTurtleHeading, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandHex, I18n::Message::PythonHex), diff --git a/apps/code/script_node_cell.cpp b/apps/code/script_node_cell.cpp index 6ea546596..21c23f756 100644 --- a/apps/code/script_node_cell.cpp +++ b/apps/code/script_node_cell.cpp @@ -13,7 +13,7 @@ void ScriptNodeCell::ScriptNodeView::drawRect(KDContext * ctx, KDRect rect) cons // If it exists, draw the description name. const char * descriptionName = m_scriptNode->description(); if (descriptionName != nullptr) { - ctx->drawString(descriptionName, KDPoint(0, m_frame.height() - k_bottomMargin - k_font->glyphSize().height()), k_font, Palette::GreyDark, backgroundColor); + ctx->drawString(descriptionName, KDPoint(0, m_frame.height() - k_bottomMargin - k_font->glyphSize().height()), k_font, Palette::GrayDark, backgroundColor); } // Draw the node name @@ -32,7 +32,7 @@ void ScriptNodeCell::ScriptNodeView::drawRect(KDContext * ctx, KDRect rect) cons const char * sourceName = m_scriptNode->nodeSourceName(); if (sourceName != nullptr) { KDSize sourceNameSize = k_font->stringSize(sourceName); - ctx->drawString(sourceName, KDPoint(m_frame.width() - sourceNameSize.width(), nodeNameY), k_font, Palette::GreyDark, backgroundColor); + ctx->drawString(sourceName, KDPoint(m_frame.width() - sourceNameSize.width(), nodeNameY), k_font, Palette::GrayDark, backgroundColor); } } diff --git a/apps/code/variable_box_controller.cpp b/apps/code/variable_box_controller.cpp index 9881b213d..c329fb7f1 100644 --- a/apps/code/variable_box_controller.cpp +++ b/apps/code/variable_box_controller.cpp @@ -45,7 +45,7 @@ VariableBoxController::VariableBoxController(ScriptStore * scriptStore) : { for (int i = 0; i < k_scriptOriginsCount; i++) { m_subtitleCells[i].setBackgroundColor(Palette::WallScreen); - m_subtitleCells[i].setTextColor(Palette::BlueishGrey); + m_subtitleCells[i].setTextColor(Palette::BlueishGray); } } diff --git a/apps/graph/app.cpp b/apps/graph/app.cpp index 464966cba..9845cecc1 100644 --- a/apps/graph/app.cpp +++ b/apps/graph/app.cpp @@ -51,7 +51,7 @@ void App::Snapshot::tidy() { App::App(Snapshot * snapshot) : FunctionApp(snapshot, &m_inputViewController), m_listController(&m_listFooter, &m_listHeader, &m_listFooter, this), - m_listFooter(&m_listHeader, &m_listController, &m_listController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGrey), + m_listFooter(&m_listHeader, &m_listController, &m_listController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGray), m_listHeader(&m_listStackViewController, &m_listFooter, &m_listController), m_listStackViewController(&m_tabViewController, &m_listHeader), m_graphController(&m_graphAlternateEmptyViewController, this, snapshot->graphRange(), snapshot->cursor(), snapshot->indexFunctionSelectedByCursor(), snapshot->modelVersion(), snapshot->previousModelsVersions(), snapshot->rangeVersion(), snapshot->angleUnitVersion(), &m_graphHeader), diff --git a/apps/graph/graph/graph_view.cpp b/apps/graph/graph/graph_view.cpp index 90120e8a4..d455cdb9d 100644 --- a/apps/graph/graph/graph_view.cpp +++ b/apps/graph/graph/graph_view.cpp @@ -73,7 +73,7 @@ void GraphView::drawRect(KDContext * ctx, KDRect rect) const { // To represent the tangent, we draw segment from and to abscissas at the extremity of the drawn rect float minAbscissa = pixelToFloat(Axis::Horizontal, rect.left()); float maxAbscissa = pixelToFloat(Axis::Horizontal, rect.right()); - drawSegment(ctx, rect, minAbscissa, tangentParameterA*minAbscissa+tangentParameterB, maxAbscissa, tangentParameterA*maxAbscissa+tangentParameterB, Palette::GreyVeryDark, false); + drawSegment(ctx, rect, minAbscissa, tangentParameterA*minAbscissa+tangentParameterB, maxAbscissa, tangentParameterA*maxAbscissa+tangentParameterB, Palette::GrayVeryDark, false); } continue; } diff --git a/apps/graph/list/list_controller.cpp b/apps/graph/list/list_controller.cpp index 224673d54..e211d3cc6 100644 --- a/apps/graph/list/list_controller.cpp +++ b/apps/graph/list/list_controller.cpp @@ -167,7 +167,7 @@ void ListController::willDisplayTitleCellAtIndex(HighlightCell * cell, int j) { // Set name and color if the name is not being edited ExpiringPointer function = modelStore()->modelForRecord(modelStore()->recordAtIndex(j)); setFunctionNameInTextField(function, titleCell->textField()); - KDColor functionNameColor = function->isActive() ? function->color() : Palette::GreyDark; + KDColor functionNameColor = function->isActive() ? function->color() : Palette::GrayDark; titleCell->setColor(functionNameColor); } } @@ -178,7 +178,7 @@ void ListController::willDisplayExpressionCellAtIndex(HighlightCell * cell, int Shared::FunctionListController::willDisplayExpressionCellAtIndex(cell, j); FunctionExpressionCell * myCell = (FunctionExpressionCell *)cell; ExpiringPointer f = modelStore()->modelForRecord(modelStore()->recordAtIndex(j)); - KDColor textColor = f->isActive() ? KDColorBlack : Palette::GreyDark; + KDColor textColor = f->isActive() ? KDColorBlack : Palette::GrayDark; myCell->setTextColor(textColor); } diff --git a/apps/hardware_test/keyboard_view.cpp b/apps/hardware_test/keyboard_view.cpp index 1b15f28df..0b7d69cef 100644 --- a/apps/hardware_test/keyboard_view.cpp +++ b/apps/hardware_test/keyboard_view.cpp @@ -59,7 +59,7 @@ void KeyboardView::drawKey(int keyIndex, KDContext * ctx, KDRect rect) const { KDColor KeyboardView::keyColor(Ion::Keyboard::Key key) const { if (!m_keyboardModel.belongsToTestedKeysSubset(key)) { - return Palette::GreyBright; + return Palette::GrayBright; } if (m_keyboardModel.testedKey() == key) { return KDColorBlue; diff --git a/apps/probability/calculation_cell.cpp b/apps/probability/calculation_cell.cpp index e8d35cf21..ea686f9d9 100644 --- a/apps/probability/calculation_cell.cpp +++ b/apps/probability/calculation_cell.cpp @@ -41,7 +41,7 @@ void CalculationCell::drawRect(KDContext * ctx, KDRect rect) const { ctx->fillRect(bounds(), KDColorWhite); if (m_isResponder) { KDSize textSize = m_text.minimalSizeForOptimalDisplay(); - ctx->strokeRect(KDRect(2*k_margin+textSize.width(), 0, calculationCellWidth()+2*ResponderImageCell::k_outline, ImageCell::k_height+2*ResponderImageCell::k_outline), Palette::GreyMiddle); + ctx->strokeRect(KDRect(2*k_margin+textSize.width(), 0, calculationCellWidth()+2*ResponderImageCell::k_outline, ImageCell::k_height+2*ResponderImageCell::k_outline), Palette::GrayMiddle); } } diff --git a/apps/probability/calculation_controller.cpp b/apps/probability/calculation_controller.cpp index 2869f5abf..9ab3ed812 100644 --- a/apps/probability/calculation_controller.cpp +++ b/apps/probability/calculation_controller.cpp @@ -26,7 +26,7 @@ namespace Probability { constexpr int CalculationController::k_titleBufferSize; CalculationController::ContentView::ContentView(SelectableTableView * selectableTableView, Distribution * distribution, Calculation * calculation) : - m_titleView(KDFont::SmallFont, I18n::Message::ComputeProbability, 0.5f, 0.5f, Palette::GreyDark, Palette::WallScreen), + m_titleView(KDFont::SmallFont, I18n::Message::ComputeProbability, 0.5f, 0.5f, Palette::GrayDark, Palette::WallScreen), m_selectableTableView(selectableTableView), m_distributionCurveView(distribution, calculation) { diff --git a/apps/probability/cell.cpp b/apps/probability/cell.cpp index 5e9a80b03..8083fbb5b 100644 --- a/apps/probability/cell.cpp +++ b/apps/probability/cell.cpp @@ -59,10 +59,10 @@ void Cell::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate height = bounds().height(); KDColor backgroundColor = isHighlighted() ? Palette::Select : KDColorWhite; ctx->fillRect(KDRect(1, 1, width-2, height-1), backgroundColor); - ctx->fillRect(KDRect(0, 0, width, 1), Palette::GreyBright); - ctx->fillRect(KDRect(0, 1, 1, height-1), Palette::GreyBright); - ctx->fillRect(KDRect(width-1, 1, 1, height-1), Palette::GreyBright); - ctx->fillRect(KDRect(0, height-1, width, 1), Palette::GreyBright); + ctx->fillRect(KDRect(0, 0, width, 1), Palette::GrayBright); + ctx->fillRect(KDRect(0, 1, 1, height-1), Palette::GrayBright); + ctx->fillRect(KDRect(width-1, 1, 1, height-1), Palette::GrayBright); + ctx->fillRect(KDRect(0, height-1, width, 1), Palette::GrayBright); } } diff --git a/apps/probability/distribution_controller.h b/apps/probability/distribution_controller.h index 22a097ff4..db276e249 100644 --- a/apps/probability/distribution_controller.h +++ b/apps/probability/distribution_controller.h @@ -26,7 +26,7 @@ private: class ContentView : public View { public: ContentView(SelectableTableView * selectableTableView) : - m_titleView(KDFont::SmallFont, I18n::Message::ChooseDistribution, 0.5f, 0.5f, Palette::GreyDark, Palette::WallScreen), + m_titleView(KDFont::SmallFont, I18n::Message::ChooseDistribution, 0.5f, 0.5f, Palette::GrayDark, Palette::WallScreen), m_selectableTableView(selectableTableView) {} constexpr static KDCoordinate k_titleMargin = 8; diff --git a/apps/probability/distribution_curve_view.cpp b/apps/probability/distribution_curve_view.cpp index fc545fe59..eb82d5a9c 100644 --- a/apps/probability/distribution_curve_view.cpp +++ b/apps/probability/distribution_curve_view.cpp @@ -31,7 +31,7 @@ void DistributionCurveView::drawRect(KDContext * ctx, KDRect rect) const { if (m_distribution->isContinuous()) { drawCartesianCurve(ctx, rect, -INFINITY, INFINITY, EvaluateXYAtAbscissa, m_distribution, nullptr, Palette::YellowDark, true, true, lowerBound, upperBound); } else { - drawHistogram(ctx, rect, EvaluateAtAbscissa, m_distribution, nullptr, 0, 1, false, Palette::GreyMiddle, Palette::YellowDark, lowerBound, upperBound+0.5f); + drawHistogram(ctx, rect, EvaluateAtAbscissa, m_distribution, nullptr, 0, 1, false, Palette::GrayMiddle, Palette::YellowDark, lowerBound, upperBound+0.5f); } } diff --git a/apps/probability/parameters_controller.cpp b/apps/probability/parameters_controller.cpp index 694a3207a..53e3c9818 100644 --- a/apps/probability/parameters_controller.cpp +++ b/apps/probability/parameters_controller.cpp @@ -8,7 +8,7 @@ namespace Probability { ParametersController::ContentView::ContentView(SelectableTableView * selectableTableView) : m_numberOfParameters(1), - m_titleView(KDFont::SmallFont, I18n::Message::ChooseParameters, 0.5f, 0.5f, Palette::GreyDark, Palette::WallScreen), + m_titleView(KDFont::SmallFont, I18n::Message::ChooseParameters, 0.5f, 0.5f, Palette::GrayDark, Palette::WallScreen), m_firstParameterDefinition(KDFont::SmallFont, (I18n::Message)0, 0.5f, 0.5f, KDColorBlack, Palette::WallScreen), m_secondParameterDefinition(KDFont::SmallFont, (I18n::Message)0, 0.5f, 0.5f, KDColorBlack, Palette::WallScreen), m_selectableTableView(selectableTableView) diff --git a/apps/probability/responder_image_cell.cpp b/apps/probability/responder_image_cell.cpp index 263c9369d..50bde318f 100644 --- a/apps/probability/responder_image_cell.cpp +++ b/apps/probability/responder_image_cell.cpp @@ -12,7 +12,7 @@ ResponderImageCell::ResponderImageCell(Responder * parentResponder, Distribution void ResponderImageCell::drawRect(KDContext * ctx, KDRect rect) const { ctx->fillRect(bounds(), KDColorWhite); - ctx->strokeRect(KDRect(0, 0, ImageCell::k_width+2*k_outline, ImageCell::k_height+2*k_outline), Palette::GreyMiddle); + ctx->strokeRect(KDRect(0, 0, ImageCell::k_width+2*k_outline, ImageCell::k_height+2*k_outline), Palette::GrayMiddle); } KDSize ResponderImageCell::minimalSizeForOptimalDisplay() const { diff --git a/apps/regression/calculation_controller.cpp b/apps/regression/calculation_controller.cpp index eb262a2ef..1beae9b81 100644 --- a/apps/regression/calculation_controller.cpp +++ b/apps/regression/calculation_controller.cpp @@ -33,11 +33,11 @@ CalculationController::CalculationController(Responder * parentResponder, Button m_columnTitleCells[i].setParentResponder(&m_selectableTableView); } for (int i = 0; i < k_numberOfDoubleCalculationCells; i++) { - m_doubleCalculationCells[i].setTextColor(Palette::GreyDark); + m_doubleCalculationCells[i].setTextColor(Palette::GrayDark); m_doubleCalculationCells[i].setParentResponder(&m_selectableTableView); } for (int i = 0; i < k_numberOfCalculationCells;i++) { - m_calculationCells[i].setTextColor(Palette::GreyDark); + m_calculationCells[i].setTextColor(Palette::GrayDark); } for (int i = 0; i < k_maxNumberOfDisplayableRows; i++) { m_titleCells[i].setMessageFont(KDFont::SmallFont); diff --git a/apps/regression/store_controller.cpp b/apps/regression/store_controller.cpp index cef9c8a72..703d08d1f 100644 --- a/apps/regression/store_controller.cpp +++ b/apps/regression/store_controller.cpp @@ -38,7 +38,7 @@ void StoreController::willDisplayCellAtLocation(HighlightCell * cell, int i, int bool isValuesColumn = i%Store::k_numberOfColumnsPerSeries == 0; mytitleCell->setSeparatorLeft(isValuesColumn && i > 0); int seriesIndex = i/Store::k_numberOfColumnsPerSeries; - mytitleCell->setColor(m_store->numberOfPairsOfSeries(seriesIndex) == 0 ? Palette::GreyDark : Store::colorOfSeriesAtIndex(seriesIndex)); // TODO Share GreyDark with graph/list_controller and statistics/store_controller + mytitleCell->setColor(m_store->numberOfPairsOfSeries(seriesIndex) == 0 ? Palette::GrayDark : Store::colorOfSeriesAtIndex(seriesIndex)); // TODO Share GrayDark with graph/list_controller and statistics/store_controller char name[] = {isValuesColumn ? 'X' : 'Y', static_cast('1' + seriesIndex), 0}; mytitleCell->setText(name); } diff --git a/apps/sequence/app.cpp b/apps/sequence/app.cpp index 505f0c9fe..9ee1e34f3 100644 --- a/apps/sequence/app.cpp +++ b/apps/sequence/app.cpp @@ -48,7 +48,7 @@ App::App(Snapshot * snapshot) : FunctionApp(snapshot, &m_inputViewController), m_sequenceContext(AppsContainer::sharedAppsContainer()->globalContext(), snapshot->functionStore()), m_listController(&m_listFooter, this, &m_listHeader, &m_listFooter), - m_listFooter(&m_listHeader, &m_listController, &m_listController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGrey), + m_listFooter(&m_listHeader, &m_listController, &m_listController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGray), m_listHeader(nullptr, &m_listFooter, &m_listController), m_listStackViewController(&m_tabViewController, &m_listHeader), m_graphController(&m_graphAlternateEmptyViewController, this, snapshot->functionStore(), snapshot->graphRange(), snapshot->cursor(), snapshot->indexFunctionSelectedByCursor(), snapshot->modelVersion(), snapshot->previousModelsVersions(), snapshot->rangeVersion(), snapshot->angleUnitVersion(), &m_graphHeader), diff --git a/apps/sequence/list/list_controller.cpp b/apps/sequence/list/list_controller.cpp index f066c4ecb..a0eedda1d 100644 --- a/apps/sequence/list/list_controller.cpp +++ b/apps/sequence/list/list_controller.cpp @@ -190,7 +190,7 @@ void ListController::willDisplayTitleCellAtIndex(HighlightCell * cell, int j) { myCell->setLayout(sequence->secondInitialConditionName()); } // Set the color - KDColor nameColor = sequence->isActive() ? sequence->color() : Palette::GreyDark; + KDColor nameColor = sequence->isActive() ? sequence->color() : Palette::GrayDark; myCell->setColor(nameColor); } @@ -208,7 +208,7 @@ void ListController::willDisplayExpressionCellAtIndex(HighlightCell * cell, int myCell->setLayout(sequence->secondInitialConditionLayout()); } bool active = sequence->isActive(); - KDColor textColor = active ? KDColorBlack : Palette::GreyDark; + KDColor textColor = active ? KDColorBlack : Palette::GrayDark; myCell->setTextColor(textColor); } diff --git a/apps/settings/sub_menu/about_controller.cpp b/apps/settings/sub_menu/about_controller.cpp index 2f93ebf75..790a36382 100644 --- a/apps/settings/sub_menu/about_controller.cpp +++ b/apps/settings/sub_menu/about_controller.cpp @@ -11,7 +11,7 @@ AboutController::AboutController(Responder * parentResponder) : for (int i = 0; i < k_totalNumberOfCell; i++) { m_cells[i].setMessageFont(KDFont::LargeFont); m_cells[i].setAccessoryFont(KDFont::SmallFont); - m_cells[i].setAccessoryTextColor(Palette::GreyDark); + m_cells[i].setAccessoryTextColor(Palette::GrayDark); } } diff --git a/apps/shared/banner_view.h b/apps/shared/banner_view.h index 86f00cbea..601f0e9c8 100644 --- a/apps/shared/banner_view.h +++ b/apps/shared/banner_view.h @@ -14,7 +14,7 @@ public: void reload() { layoutSubviews(); } static constexpr const KDFont * Font() { return KDFont::SmallFont; } static constexpr KDColor TextColor() { return KDColorBlack; } - static constexpr KDColor BackgroundColor() { return Palette::GreyMiddle; } + static constexpr KDColor BackgroundColor() { return Palette::GrayMiddle; } private: static constexpr KDCoordinate LineSpacing = 2; int numberOfSubviews() const override = 0; diff --git a/apps/shared/buffer_text_view_with_text_field.cpp b/apps/shared/buffer_text_view_with_text_field.cpp index 2bf40a873..30008741d 100644 --- a/apps/shared/buffer_text_view_with_text_field.cpp +++ b/apps/shared/buffer_text_view_with_text_field.cpp @@ -35,7 +35,7 @@ void BufferTextViewWithTextField::drawRect(KDContext * ctx, KDRect rect) const { // Draw the text field border KDRect borderRect = KDRect(textFieldRect.x()-k_borderWidth, textFieldRect.y()-k_borderWidth, textFieldRect.width()+2*k_borderWidth, textFieldRect.height()+2*k_borderWidth); - ctx->strokeRect(borderRect, Palette::GreyMiddle); + ctx->strokeRect(borderRect, Palette::GrayMiddle); } void BufferTextViewWithTextField::didBecomeFirstResponder() { diff --git a/apps/shared/button_with_separator.cpp b/apps/shared/button_with_separator.cpp index faf1fe013..0dabce424 100644 --- a/apps/shared/button_with_separator.cpp +++ b/apps/shared/button_with_separator.cpp @@ -8,15 +8,15 @@ ButtonWithSeparator::ButtonWithSeparator(Responder * parentResponder, I18n::Mess void ButtonWithSeparator::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); - ctx->fillRect(KDRect(0, 0, width, k_lineThickness), Palette::GreyBright); + ctx->fillRect(KDRect(0, 0, width, k_lineThickness), Palette::GrayBright); ctx->fillRect(KDRect(0, k_lineThickness, width, k_margin-k_lineThickness), Palette::WallScreen); // Draw rectangle around cell - ctx->fillRect(KDRect(0, k_margin, width, k_lineThickness), Palette::GreyBright); - ctx->fillRect(KDRect(0, k_margin+k_lineThickness, k_lineThickness, height-k_margin), Palette::GreyBright); - ctx->fillRect(KDRect(width-k_lineThickness, k_lineThickness+k_margin, k_lineThickness, height-k_margin), Palette::GreyBright); - ctx->fillRect(KDRect(0, height-3*k_lineThickness, width, k_lineThickness), Palette::GreyWhite); - ctx->fillRect(KDRect(0, height-2*k_lineThickness, width, k_lineThickness), Palette::GreyBright); - ctx->fillRect(KDRect(k_lineThickness, height-k_lineThickness, width-2*k_lineThickness, k_lineThickness), Palette::GreyMiddle); + ctx->fillRect(KDRect(0, k_margin, width, k_lineThickness), Palette::GrayBright); + ctx->fillRect(KDRect(0, k_margin+k_lineThickness, k_lineThickness, height-k_margin), Palette::GrayBright); + ctx->fillRect(KDRect(width-k_lineThickness, k_lineThickness+k_margin, k_lineThickness, height-k_margin), Palette::GrayBright); + ctx->fillRect(KDRect(0, height-3*k_lineThickness, width, k_lineThickness), Palette::GrayWhite); + ctx->fillRect(KDRect(0, height-2*k_lineThickness, width, k_lineThickness), Palette::GrayBright); + ctx->fillRect(KDRect(k_lineThickness, height-k_lineThickness, width-2*k_lineThickness, k_lineThickness), Palette::GrayMiddle); } diff --git a/apps/shared/curve_view.cpp b/apps/shared/curve_view.cpp index 77003ab40..dd594964a 100644 --- a/apps/shared/curve_view.cpp +++ b/apps/shared/curve_view.cpp @@ -536,8 +536,8 @@ void CurveView::drawArrow(KDContext * ctx, KDRect rect, float x, float y, float } void CurveView::drawGrid(KDContext * ctx, KDRect rect) const { - KDColor boldColor = Palette::GreyMiddle; - KDColor lightColor = Palette::GreyWhite; + KDColor boldColor = Palette::GrayMiddle; + KDColor lightColor = Palette::GrayWhite; drawGridLines(ctx, rect, Axis::Vertical, m_curveViewRange->xGridUnit(), boldColor, lightColor); drawGridLines(ctx, rect, Axis::Horizontal, m_curveViewRange->yGridUnit(), boldColor, lightColor); } diff --git a/apps/shared/range_parameter_controller.cpp b/apps/shared/range_parameter_controller.cpp index ecfb92b16..042253466 100644 --- a/apps/shared/range_parameter_controller.cpp +++ b/apps/shared/range_parameter_controller.cpp @@ -57,7 +57,7 @@ void RangeParameterController::willDisplayCellForIndex(HighlightCell * cell, int MessageTableCellWithEditableText * myCell = (MessageTableCellWithEditableText *)cell; I18n::Message labels[k_numberOfTextCell+1] = {I18n::Message::XMin, I18n::Message::XMax, I18n::Message::Default, I18n::Message::YMin, I18n::Message::YMax}; myCell->setMessage(labels[index]); - KDColor yColor = m_tempInteractiveRange.yAuto() ? Palette::GreyDark : KDColorBlack; + KDColor yColor = m_tempInteractiveRange.yAuto() ? Palette::GrayDark : KDColorBlack; KDColor colors[k_numberOfTextCell+1] = {KDColorBlack, KDColorBlack, KDColorBlack, yColor, yColor}; myCell->setTextColor(colors[index]); FloatParameterController::willDisplayCellForIndex(cell, index); diff --git a/apps/shared/scrollable_multiple_expressions_view.cpp b/apps/shared/scrollable_multiple_expressions_view.cpp index ed9bb5db7..1ea21525c 100644 --- a/apps/shared/scrollable_multiple_expressions_view.cpp +++ b/apps/shared/scrollable_multiple_expressions_view.cpp @@ -8,7 +8,7 @@ namespace Shared { AbstractScrollableMultipleExpressionsView::ContentCell::ContentCell() : m_rightExpressionView(), - m_approximateSign(k_font, k_defaultApproximateMessage, 0.5f, 0.5f, Palette::GreyVeryDark), + m_approximateSign(k_font, k_defaultApproximateMessage, 0.5f, 0.5f, Palette::GrayVeryDark), m_centeredExpressionView(), m_selectedSubviewPosition(SubviewPosition::Center), m_displayCenter(true) @@ -48,7 +48,7 @@ void AbstractScrollableMultipleExpressionsView::ContentCell::setEven(bool even) void AbstractScrollableMultipleExpressionsView::ContentCell::reloadTextColor() { if (displayCenter()) { - m_rightExpressionView.setTextColor(Palette::GreyVeryDark); + m_rightExpressionView.setTextColor(Palette::GrayVeryDark); } else { m_rightExpressionView.setTextColor(KDColorBlack); } diff --git a/apps/shared/sum_graph_controller.cpp b/apps/shared/sum_graph_controller.cpp index 5a3282914..02b42800a 100644 --- a/apps/shared/sum_graph_controller.cpp +++ b/apps/shared/sum_graph_controller.cpp @@ -155,16 +155,16 @@ void SumGraphController::reloadBannerView() { /* Legend View */ SumGraphController::LegendView::LegendView(SumGraphController * controller, InputEventHandlerDelegate * inputEventHandlerDelegate, CodePoint sumSymbol) : - m_sum(0.0f, 0.5f, KDColorBlack, Palette::GreyMiddle), - m_legend(k_font, I18n::Message::Default, 0.0f, 0.5f, KDColorBlack, Palette::GreyMiddle), - m_editableZone(controller, m_textBuffer, k_editableZoneBufferSize, TextField::maxBufferSize(), inputEventHandlerDelegate, controller, k_font, 0.0f, 0.5f, KDColorBlack, Palette::GreyMiddle), + m_sum(0.0f, 0.5f, KDColorBlack, Palette::GrayMiddle), + m_legend(k_font, I18n::Message::Default, 0.0f, 0.5f, KDColorBlack, Palette::GrayMiddle), + m_editableZone(controller, m_textBuffer, k_editableZoneBufferSize, TextField::maxBufferSize(), inputEventHandlerDelegate, controller, k_font, 0.0f, 0.5f, KDColorBlack, Palette::GrayMiddle), m_sumSymbol(sumSymbol) { m_textBuffer[0] = 0; } void SumGraphController::LegendView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(bounds(), Palette::GreyMiddle); + ctx->fillRect(bounds(), Palette::GrayMiddle); } KDSize SumGraphController::LegendView::minimalSizeForOptimalDisplay() const { diff --git a/apps/shared/zoom_parameter_controller.cpp b/apps/shared/zoom_parameter_controller.cpp index 5f45669fb..f468aff72 100644 --- a/apps/shared/zoom_parameter_controller.cpp +++ b/apps/shared/zoom_parameter_controller.cpp @@ -86,7 +86,7 @@ ZoomParameterController::ContentView::LegendView::LegendView() for (int i = 0; i < k_numberOfLegends; i++) { m_legends[i].setFont(KDFont::SmallFont); m_legends[i].setMessage(messages[i]); - m_legends[i].setBackgroundColor(Palette::GreyBright); + m_legends[i].setBackgroundColor(Palette::GrayBright); m_legends[i].setAlignment(horizontalAlignments[i], 0.5f); } KeyView::Type tokenTypes[k_numberOfTokens] = {KeyView::Type::Up, KeyView::Type::Down, KeyView::Type::Left, KeyView::Type::Right, KeyView::Type::Plus, KeyView::Type::Minus}; @@ -96,7 +96,7 @@ ZoomParameterController::ContentView::LegendView::LegendView() } void ZoomParameterController::ContentView::LegendView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(KDRect(0, bounds().height() - k_legendHeight, bounds().width(), k_legendHeight), Palette::GreyBright); + ctx->fillRect(KDRect(0, bounds().height() - k_legendHeight, bounds().width(), k_legendHeight), Palette::GrayBright); } int ZoomParameterController::ContentView::LegendView::numberOfSubviews() const { diff --git a/apps/solver/app.cpp b/apps/solver/app.cpp index c97ee1048..bce24a518 100644 --- a/apps/solver/app.cpp +++ b/apps/solver/app.cpp @@ -48,7 +48,7 @@ App::App(Snapshot * snapshot) : m_intervalController(nullptr, this, snapshot->equationStore()), m_alternateEmptyViewController(nullptr, &m_solutionsController, &m_solutionsController), m_listController(&m_listFooter, snapshot->equationStore(), &m_listFooter), - m_listFooter(&m_stackViewController, &m_listController, &m_listController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGrey, ButtonRowController::Size::Large), + m_listFooter(&m_stackViewController, &m_listController, &m_listController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGray, ButtonRowController::Size::Large), m_stackViewController(&m_inputViewController, &m_listFooter), m_inputViewController(&m_modalViewController, &m_stackViewController, this, &m_listController, &m_listController) { diff --git a/apps/statistics/box_view.cpp b/apps/statistics/box_view.cpp index 414964305..eb7d00886 100644 --- a/apps/statistics/box_view.cpp +++ b/apps/statistics/box_view.cpp @@ -63,7 +63,7 @@ void BoxView::drawRect(KDContext * ctx, KDRect rect) const { double thirdQuart = m_store->thirdQuartile(m_series); double maxVal = m_store->maxValue(m_series); - KDColor boxColor = isMainViewSelected() ? m_selectedHistogramLightColor : Palette::GreyWhite; + KDColor boxColor = isMainViewSelected() ? m_selectedHistogramLightColor : Palette::GrayWhite; // Draw the main box KDCoordinate firstQuartilePixels = std::round(floatToPixel(Axis::Horizontal, firstQuart)); KDCoordinate thirdQuartilePixels = std::round(floatToPixel(Axis::Horizontal, thirdQuart)); @@ -71,7 +71,7 @@ void BoxView::drawRect(KDContext * ctx, KDRect rect) const { upBoundPixel-lowBoundPixel), boxColor); // Draw the horizontal lines linking the box to the extreme bounds - KDColor horizontalColor = isMainViewSelected() ? m_selectedHistogramColor : Palette::GreyDark; + KDColor horizontalColor = isMainViewSelected() ? m_selectedHistogramColor : Palette::GrayDark; float segmentOrd = (lowBound + upBound)/ 2.0f; drawHorizontalOrVerticalSegment(ctx, rect, Axis::Horizontal, segmentOrd, minVal, firstQuart, horizontalColor); drawHorizontalOrVerticalSegment(ctx, rect, Axis::Horizontal, segmentOrd, thirdQuart, maxVal, horizontalColor); @@ -83,7 +83,7 @@ void BoxView::drawRect(KDContext * ctx, KDRect rect) const { * lines. This solution could hide the highlighted line by coloring the next * quantile if it has the same value. */ for (int k = 0; k < 5; k++) { - drawHorizontalOrVerticalSegment(ctx, rect, Axis::Vertical, calculations[k], lowBound, upBound, Palette::GreyMiddle, k_quantileBarWidth); + drawHorizontalOrVerticalSegment(ctx, rect, Axis::Vertical, calculations[k], lowBound, upBound, Palette::GrayMiddle, k_quantileBarWidth); } if (isMainViewSelected()) { drawHorizontalOrVerticalSegment(ctx, rect, Axis::Vertical, calculations[(int)*m_selectedQuantile], lowBound, upBound, Palette::YellowDark, k_quantileBarWidth); diff --git a/apps/statistics/calculation_controller.cpp b/apps/statistics/calculation_controller.cpp index de553cf1b..2a0f52e0a 100644 --- a/apps/statistics/calculation_controller.cpp +++ b/apps/statistics/calculation_controller.cpp @@ -30,7 +30,7 @@ CalculationController::CalculationController(Responder * parentResponder, Button m_calculationTitleCells[i].setMessageFont(KDFont::SmallFont); } for (int i = 0; i < k_numberOfCalculationCells; i++) { - m_calculationCells[i].setTextColor(Palette::GreyDark); + m_calculationCells[i].setTextColor(Palette::GrayDark); } m_hideableCell.setHide(true); } diff --git a/apps/statistics/histogram_view.h b/apps/statistics/histogram_view.h index f72cbac1a..a2b050c46 100644 --- a/apps/statistics/histogram_view.h +++ b/apps/statistics/histogram_view.h @@ -13,7 +13,7 @@ class HistogramController; class HistogramView : public Shared::HorizontallyLabeledCurveView { public: - HistogramView(HistogramController * controller, Store * store, int series, Shared::BannerView * bannerView, KDColor selectedHistogramColor = Palette::Select, KDColor notSelectedHistogramColor = Palette::GreyMiddle, KDColor selectedBarColor = Palette::YellowDark); + HistogramView(HistogramController * controller, Store * store, int series, Shared::BannerView * bannerView, KDColor selectedHistogramColor = Palette::Select, KDColor notSelectedHistogramColor = Palette::GrayMiddle, KDColor selectedBarColor = Palette::YellowDark); int series() const { return m_series; } void reload() override; void reloadSelectedBar(); diff --git a/apps/statistics/store_controller.cpp b/apps/statistics/store_controller.cpp index 7c87285a5..ad7ae5a49 100644 --- a/apps/statistics/store_controller.cpp +++ b/apps/statistics/store_controller.cpp @@ -49,7 +49,7 @@ void StoreController::willDisplayCellAtLocation(HighlightCell * cell, int i, int I18n::Message sizesMessages[] = {I18n::Message::Sizes1, I18n::Message::Sizes2, I18n::Message::Sizes3}; mytitleCell->setText(I18n::translate(sizesMessages[seriesIndex])); } - mytitleCell->setColor(m_store->numberOfPairsOfSeries(seriesIndex) == 0 ? Palette::GreyDark : Store::colorOfSeriesAtIndex(seriesIndex)); // TODO Share GreyDark with graph/list_controller + mytitleCell->setColor(m_store->numberOfPairsOfSeries(seriesIndex) == 0 ? Palette::GrayDark : Store::colorOfSeriesAtIndex(seriesIndex)); // TODO Share GrayDark with graph/list_controller } HighlightCell * StoreController::titleCells(int index) { diff --git a/escher/include/escher/button_row_controller.h b/escher/include/escher/button_row_controller.h index 120603339..9f0d75f80 100644 --- a/escher/include/escher/button_row_controller.h +++ b/escher/include/escher/button_row_controller.h @@ -18,7 +18,7 @@ public: }; enum class Style { PlainWhite, - EmbossedGrey + EmbossedGray }; enum class Size { Small, diff --git a/escher/include/escher/palette.h b/escher/include/escher/palette.h index c50b276b7..7923409f8 100644 --- a/escher/include/escher/palette.h +++ b/escher/include/escher/palette.h @@ -10,11 +10,11 @@ public: constexpr static KDColor YellowLight = KDColor::RGB24(0xffcc7b); constexpr static KDColor PurpleBright = KDColor::RGB24(0x656975); constexpr static KDColor PurpleDark = KDColor::RGB24(0x414147); - constexpr static KDColor GreyWhite = KDColor::RGB24(0xf5f5f5); - constexpr static KDColor GreyBright = KDColor::RGB24(0xececec); - constexpr static KDColor GreyMiddle = KDColor::RGB24(0xd9d9d9); - constexpr static KDColor GreyDark = KDColor::RGB24(0xa7a7a7); - constexpr static KDColor GreyVeryDark = KDColor::RGB24(0x8c8c8c); + constexpr static KDColor GrayWhite = KDColor::RGB24(0xf5f5f5); + constexpr static KDColor GrayBright = KDColor::RGB24(0xececec); + constexpr static KDColor GrayMiddle = KDColor::RGB24(0xd9d9d9); + constexpr static KDColor GrayDark = KDColor::RGB24(0xa7a7a7); + constexpr static KDColor GrayVeryDark = KDColor::RGB24(0x8c8c8c); constexpr static KDColor Select = KDColor::RGB24(0xd4d7e0); constexpr static KDColor SelectDark = KDColor::RGB24(0xb0b8d8); constexpr static KDColor WallScreen = KDColor::RGB24(0xf7f9fa); @@ -33,7 +33,7 @@ public: constexpr static KDColor GreenLight = KDColor::RGB24(0x52db8f); constexpr static KDColor Brown = KDColor::RGB24(0x8d7350); constexpr static KDColor Purple = KDColor::RGB24(0x6e2d79); - constexpr static KDColor BlueishGrey = KDColor::RGB24(0x919ea4); + constexpr static KDColor BlueishGray = KDColor::RGB24(0x919ea4); constexpr static KDColor Cyan = KDColor::RGB24(0x00ffff); constexpr static KDColor DataColor[] = {Red, Blue, Green, YellowDark, Magenta, Turquoise, Pink, Orange}; constexpr static KDColor DataColorLight[] = {RedLight, BlueLight, GreenLight, YellowLight}; diff --git a/escher/include/escher/stack_view_controller.h b/escher/include/escher/stack_view_controller.h index 48bf9a114..d13d4fb9d 100644 --- a/escher/include/escher/stack_view_controller.h +++ b/escher/include/escher/stack_view_controller.h @@ -10,10 +10,10 @@ constexpr uint8_t kMaxNumberOfStacks = 4; class StackViewController : public ViewController { public: StackViewController(Responder * parentResponder, ViewController * rootViewController, - KDColor textColor = Palette::SubTab, KDColor backgroundColor = KDColorWhite, KDColor separatorColor = Palette::GreyBright); + KDColor textColor = Palette::SubTab, KDColor backgroundColor = KDColorWhite, KDColor separatorColor = Palette::GrayBright); /* Push creates a new StackView and adds it */ - void push(ViewController * vc, KDColor textColor = Palette::SubTab, KDColor backgroundColor = KDColorWhite, KDColor separatorColor = Palette::GreyBright); + void push(ViewController * vc, KDColor textColor = Palette::SubTab, KDColor backgroundColor = KDColorWhite, KDColor separatorColor = Palette::GrayBright); void pop(); int depth() const { return m_numberOfChildren; } @@ -28,7 +28,7 @@ public: private: class Frame { public: - Frame(ViewController * viewController = nullptr, KDColor textColor = Palette::SubTab, KDColor backgroundColor = KDColorWhite, KDColor separatorColor = Palette::GreyBright) : + Frame(ViewController * viewController = nullptr, KDColor textColor = Palette::SubTab, KDColor backgroundColor = KDColorWhite, KDColor separatorColor = Palette::GrayBright) : m_viewController(viewController), m_textColor(textColor), m_backgroundColor(backgroundColor), diff --git a/escher/src/button_row_controller.cpp b/escher/src/button_row_controller.cpp index 4a0633764..95471ee0d 100644 --- a/escher/src/button_row_controller.cpp +++ b/escher/src/button_row_controller.cpp @@ -72,7 +72,7 @@ void ButtonRowController::ContentView::layoutSubviews(bool force) { KDCoordinate widthMargin = 0; KDCoordinate buttonHeightMargin = 0; KDCoordinate buttonHeight = rowHeight; - if (m_style == Style::EmbossedGrey) { + if (m_style == Style::EmbossedGray) { KDCoordinate totalButtonWidth = 0; for (int i = 0; i < nbOfButtons; i++) { Button * button = buttonAtIndex(i); @@ -96,28 +96,28 @@ void ButtonRowController::ContentView::layoutSubviews(bool force) { void ButtonRowController::ContentView::drawRect(KDContext * ctx, KDRect rect) const { if (numberOfButtons() == 0) { if (m_position == Position::Top) { - ctx->fillRect(KDRect(0, 0, bounds().width(), 1), Palette::GreyWhite); + ctx->fillRect(KDRect(0, 0, bounds().width(), 1), Palette::GrayWhite); } return; } if (m_style == Style::PlainWhite) { if (m_position == Position::Top) { ctx->fillRect(KDRect(0, 0, bounds().width(), k_plainStyleHeight), KDColorWhite); - ctx->fillRect(KDRect(0, k_plainStyleHeight, bounds().width(), 1), Palette::GreyWhite); + ctx->fillRect(KDRect(0, k_plainStyleHeight, bounds().width(), 1), Palette::GrayWhite); } else { ctx->fillRect(KDRect(0, bounds().height() - k_plainStyleHeight, bounds().width(), k_plainStyleHeight), KDColorWhite); - ctx->fillRect(KDRect(0, bounds().height() - k_plainStyleHeight-1, bounds().width(), 1), Palette::GreyWhite); + ctx->fillRect(KDRect(0, bounds().height() - k_plainStyleHeight-1, bounds().width(), 1), Palette::GrayWhite); } return; } int buttonHeight = m_size == Size::Small ? k_embossedStyleHeightSmall : k_embossedStyleHeightLarge; int buttonMargin = m_size == Size::Small ? k_embossedStyleHeightMarginSmall : k_embossedStyleHeightMarginLarge; if (m_position == Position::Top) { - ctx->fillRect(KDRect(0, 0, bounds().width(), buttonHeight), Palette::GreyWhite); - ctx->fillRect(KDRect(0, buttonHeight, bounds().width(), 1), Palette::GreyMiddle); + ctx->fillRect(KDRect(0, 0, bounds().width(), buttonHeight), Palette::GrayWhite); + ctx->fillRect(KDRect(0, buttonHeight, bounds().width(), 1), Palette::GrayMiddle); } else { - ctx->fillRect(KDRect(0, bounds().height() - buttonHeight, bounds().width(), buttonHeight), Palette::GreyWhite); - ctx->fillRect(KDRect(0, bounds().height() - buttonHeight-1, bounds().width(), 1), Palette::GreyMiddle); + ctx->fillRect(KDRect(0, bounds().height() - buttonHeight, bounds().width(), buttonHeight), Palette::GrayWhite); + ctx->fillRect(KDRect(0, bounds().height() - buttonHeight-1, bounds().width(), 1), Palette::GrayMiddle); } KDCoordinate y0 = m_position == Position::Top ? buttonMargin-1 : bounds().height()-buttonHeight+buttonMargin-1; KDCoordinate y1 = m_position == Position::Top ? buttonHeight-buttonMargin-2 : bounds().height()-buttonMargin; @@ -132,12 +132,12 @@ void ButtonRowController::ContentView::drawRect(KDContext * ctx, KDRect rect) co for (int i = 0; i < numberOfButtons(); i++) { Button * button = buttonAtIndex(i); KDCoordinate buttonWidth = button->minimalSizeForOptimalDisplay().width(); - ctx->fillRect(KDRect(currentXOrigin, y0, 1, y1-y0+1), Palette::GreyMiddle); - ctx->fillRect(KDRect(currentXOrigin-1, y0, 1, y1-y0+2), Palette::GreyDark); - ctx->fillRect(KDRect(currentXOrigin, y0, buttonWidth+2, 1), Palette::GreyMiddle); - ctx->fillRect(KDRect(currentXOrigin, y1, buttonWidth+2, 1), Palette::GreyMiddle); - ctx->fillRect(KDRect(currentXOrigin, y1+1, buttonWidth+2, 1), Palette::GreyDark); - ctx->fillRect(KDRect(currentXOrigin+1+buttonWidth, y0, 1, y1-y0+1), Palette::GreyMiddle); + ctx->fillRect(KDRect(currentXOrigin, y0, 1, y1-y0+1), Palette::GrayMiddle); + ctx->fillRect(KDRect(currentXOrigin-1, y0, 1, y1-y0+2), Palette::GrayDark); + ctx->fillRect(KDRect(currentXOrigin, y0, buttonWidth+2, 1), Palette::GrayMiddle); + ctx->fillRect(KDRect(currentXOrigin, y1, buttonWidth+2, 1), Palette::GrayMiddle); + ctx->fillRect(KDRect(currentXOrigin, y1+1, buttonWidth+2, 1), Palette::GrayDark); + ctx->fillRect(KDRect(currentXOrigin+1+buttonWidth, y0, 1, y1-y0+1), Palette::GrayMiddle); currentXOrigin += buttonWidth + widthMargin; } } diff --git a/escher/src/expression_field.cpp b/escher/src/expression_field.cpp index ad75892c7..bd23d662e 100644 --- a/escher/src/expression_field.cpp +++ b/escher/src/expression_field.cpp @@ -77,7 +77,7 @@ void ExpressionField::layoutSubviews(bool force) { void ExpressionField::drawRect(KDContext * ctx, KDRect rect) const { // Draw the separator - ctx->fillRect(KDRect(0, 0, bounds().width(), k_separatorThickness), Palette::GreyMiddle); + ctx->fillRect(KDRect(0, 0, bounds().width(), k_separatorThickness), Palette::GrayMiddle); } bool ExpressionField::handleEvent(Ion::Events::Event event) { diff --git a/escher/src/expression_table_cell_with_expression.cpp b/escher/src/expression_table_cell_with_expression.cpp index 8e5e8b196..3d5ca3ff2 100644 --- a/escher/src/expression_table_cell_with_expression.cpp +++ b/escher/src/expression_table_cell_with_expression.cpp @@ -5,7 +5,7 @@ ExpressionTableCellWithExpression::ExpressionTableCellWithExpression(Responder * parentResponder) : ExpressionTableCell(parentResponder, Layout::HorizontalLeftOverlap), - m_accessoryExpressionView(this, k_horizontalMargin, 0, 1.0f, 0.5f, Palette::GreyDark, KDColorWhite) + m_accessoryExpressionView(this, k_horizontalMargin, 0, 1.0f, 0.5f, Palette::GrayDark, KDColorWhite) {} View * ExpressionTableCellWithExpression::accessoryView() const { diff --git a/escher/src/expression_table_cell_with_pointer.cpp b/escher/src/expression_table_cell_with_pointer.cpp index 2f51962e0..b0d1d3a79 100644 --- a/escher/src/expression_table_cell_with_pointer.cpp +++ b/escher/src/expression_table_cell_with_pointer.cpp @@ -4,7 +4,7 @@ ExpressionTableCellWithPointer::ExpressionTableCellWithPointer(Responder * parentResponder, I18n::Message accessoryMessage, Layout layout) : ExpressionTableCell(parentResponder, layout), - m_accessoryView(KDFont::SmallFont, accessoryMessage, 0.0f, 0.5f, Palette::GreyDark, KDColorWhite) + m_accessoryView(KDFont::SmallFont, accessoryMessage, 0.0f, 0.5f, Palette::GrayDark, KDColorWhite) { if (layout != Layout::Vertical) { m_accessoryView.setAlignment(1.0f, 0.5f); diff --git a/escher/src/gauge_view.cpp b/escher/src/gauge_view.cpp index 71c0dc05d..4f06bbd32 100644 --- a/escher/src/gauge_view.cpp +++ b/escher/src/gauge_view.cpp @@ -48,7 +48,7 @@ void GaugeView::drawRect(KDContext * ctx, KDRect rect) const { KDColor gaugeIndicatorWorkingBuffer[GaugeView::k_indicatorDiameter*GaugeView::k_indicatorDiameter]; ctx->fillRect(KDRect(k_indicatorDiameter/2, (height-k_thickness)/2, width*m_level, k_thickness), Palette::YellowDark); - ctx->fillRect(KDRect(k_indicatorDiameter/2+width*m_level, (height-k_thickness)/2, width*(1.0f-m_level), k_thickness), Palette::GreyDark); + ctx->fillRect(KDRect(k_indicatorDiameter/2+width*m_level, (height-k_thickness)/2, width*(1.0f-m_level), k_thickness), Palette::GrayDark); KDRect frame(width*m_level, (height-k_indicatorDiameter)/2, k_indicatorDiameter, k_indicatorDiameter); ctx->blendRectWithMask(frame, Palette::YellowDark, (const uint8_t *)gaugeIndicatorMask, gaugeIndicatorWorkingBuffer); } diff --git a/escher/src/layout_field.cpp b/escher/src/layout_field.cpp index 4ee8e166f..26f460061 100644 --- a/escher/src/layout_field.cpp +++ b/escher/src/layout_field.cpp @@ -43,9 +43,9 @@ bool LayoutField::ContentView::setEditing(bool isEditing) { void LayoutField::ContentView::useInsertionCursor() { if (m_insertionCursor.isDefined()) { - m_cursor.layout().removeGreySquaresFromAllMatrixAncestors(); + m_cursor.layout().removeGraySquaresFromAllMatrixAncestors(); m_cursor = m_insertionCursor; - m_cursor.layout().addGreySquaresToAllMatrixAncestors(); + m_cursor.layout().addGraySquaresToAllMatrixAncestors(); } } @@ -241,7 +241,7 @@ void LayoutField::ContentView::deleteSelection() { void LayoutField::ContentView::updateInsertionCursor() { if (!m_insertionCursor.isDefined()) { Layout l = m_cursor.layout(); - if (l.type() == LayoutNode::Type::EmptyLayout && static_cast(l).color() == EmptyLayoutNode::Color::Grey) { + if (l.type() == LayoutNode::Type::EmptyLayout && static_cast(l).color() == EmptyLayoutNode::Color::Gray) { // Don't set m_insertionCursor pointing to a layout which might disappear return; } @@ -335,7 +335,7 @@ CodePoint LayoutField::XNTCodePoint(CodePoint defaultXNTCodePoint) { } void LayoutField::putCursorRightOfLayout() { - m_contentView.cursor()->layout().removeGreySquaresFromAllMatrixAncestors(); + m_contentView.cursor()->layout().removeGraySquaresFromAllMatrixAncestors(); m_contentView.cursor()->showEmptyLayoutIfNeeded(); m_contentView.setCursor(LayoutCursor(m_contentView.expressionView()->layout(), LayoutCursor::Position::Right)); } @@ -448,11 +448,11 @@ bool LayoutField::handleEvent(Ion::Events::Event event) { Layout p = selectStart->parent(); assert(p == selectEnd->parent()); assert(p.type() == LayoutNode::Type::HorizontalLayout); - removedSquares = p.removeGreySquaresFromAllMatrixChildren(); + removedSquares = p.removeGraySquaresFromAllMatrixChildren(); } else { - removedSquares = selectStart->removeGreySquaresFromAllMatrixChildren(); + removedSquares = selectStart->removeGraySquaresFromAllMatrixChildren(); } - shouldRecomputeLayout = m_contentView.cursor()->layout().removeGreySquaresFromAllMatrixChildren() || removedSquares || shouldRecomputeLayout; + shouldRecomputeLayout = m_contentView.cursor()->layout().removeGraySquaresFromAllMatrixChildren() || removedSquares || shouldRecomputeLayout; } } else if (privateHandleEvent(event, &shouldScrollAndRedraw)) { if (!shouldScrollAndRedraw) { @@ -751,7 +751,7 @@ void LayoutField::insertLayoutAtCursor(Layout layoutR, Poincare::Expression corr } // Handle matrices - cursor->layout().addGreySquaresToAllMatrixAncestors(); + cursor->layout().addGraySquaresToAllMatrixAncestors(); // Handle empty layouts cursor->hideEmptyLayoutIfNeeded(); diff --git a/escher/src/message_table_cell_with_chevron_and_buffer.cpp b/escher/src/message_table_cell_with_chevron_and_buffer.cpp index 507ac5e82..ea1f87d1c 100644 --- a/escher/src/message_table_cell_with_chevron_and_buffer.cpp +++ b/escher/src/message_table_cell_with_chevron_and_buffer.cpp @@ -3,7 +3,7 @@ MessageTableCellWithChevronAndBuffer::MessageTableCellWithChevronAndBuffer(const KDFont * labelFont, const KDFont * subAccessoryFont) : MessageTableCellWithChevron((I18n::Message)0, labelFont), - m_subAccessoryView(subAccessoryFont, 1.0f, 0.5f, Palette::GreyDark) + m_subAccessoryView(subAccessoryFont, 1.0f, 0.5f, Palette::GrayDark) { } diff --git a/escher/src/message_table_cell_with_chevron_and_expression.cpp b/escher/src/message_table_cell_with_chevron_and_expression.cpp index 01af387dd..9fd58e52d 100644 --- a/escher/src/message_table_cell_with_chevron_and_expression.cpp +++ b/escher/src/message_table_cell_with_chevron_and_expression.cpp @@ -4,7 +4,7 @@ MessageTableCellWithChevronAndExpression::MessageTableCellWithChevronAndExpression(I18n::Message message, const KDFont * font) : MessageTableCellWithChevron(message, font), - m_subtitleView(1.0f, 0.5f, Palette::GreyDark) + m_subtitleView(1.0f, 0.5f, Palette::GrayDark) { m_subtitleView.setHorizontalMargin(Metric::ExpressionViewHorizontalMargin); } diff --git a/escher/src/message_table_cell_with_chevron_and_message.cpp b/escher/src/message_table_cell_with_chevron_and_message.cpp index ff4d8a952..cbca095df 100644 --- a/escher/src/message_table_cell_with_chevron_and_message.cpp +++ b/escher/src/message_table_cell_with_chevron_and_message.cpp @@ -3,7 +3,7 @@ MessageTableCellWithChevronAndMessage::MessageTableCellWithChevronAndMessage(const KDFont * labelFont, const KDFont * contentFont) : MessageTableCellWithChevron((I18n::Message)0, labelFont), - m_subtitleView(contentFont, (I18n::Message)0, 1.0f, 0.5f, Palette::GreyDark) + m_subtitleView(contentFont, (I18n::Message)0, 1.0f, 0.5f, Palette::GrayDark) { } diff --git a/escher/src/message_table_cell_with_expression.cpp b/escher/src/message_table_cell_with_expression.cpp index 144fa5c81..f36244177 100644 --- a/escher/src/message_table_cell_with_expression.cpp +++ b/escher/src/message_table_cell_with_expression.cpp @@ -3,7 +3,7 @@ MessageTableCellWithExpression::MessageTableCellWithExpression(I18n::Message message, const KDFont * font) : MessageTableCell(message, font), - m_subtitleView(1.0f, 0.5f, Palette::GreyDark) + m_subtitleView(1.0f, 0.5f, Palette::GrayDark) { } diff --git a/escher/src/modal_view_empty_controller.cpp b/escher/src/modal_view_empty_controller.cpp index 23f370a6c..99757cfda 100644 --- a/escher/src/modal_view_empty_controller.cpp +++ b/escher/src/modal_view_empty_controller.cpp @@ -30,7 +30,7 @@ void ModalViewEmptyController::ModalViewEmptyView::setMessages(I18n::Message * m void ModalViewEmptyController::ModalViewEmptyView::drawRect(KDContext * ctx, KDRect rect) const { ctx->fillRect(bounds(), k_backgroundColor); - drawBorderOfRect(ctx, bounds(), Palette::GreyBright); + drawBorderOfRect(ctx, bounds(), Palette::GrayBright); } int ModalViewEmptyController::ModalViewEmptyView::numberOfSubviews() const { diff --git a/escher/src/palette.cpp b/escher/src/palette.cpp index ac7cd7279..6e5e611d7 100644 --- a/escher/src/palette.cpp +++ b/escher/src/palette.cpp @@ -5,11 +5,11 @@ constexpr KDColor Palette::YellowDark; constexpr KDColor Palette::YellowLight; constexpr KDColor Palette::PurpleBright; constexpr KDColor Palette::PurpleDark; -constexpr KDColor Palette::GreyWhite; -constexpr KDColor Palette::GreyBright; -constexpr KDColor Palette::GreyMiddle; -constexpr KDColor Palette::GreyDark; -constexpr KDColor Palette::GreyVeryDark; +constexpr KDColor Palette::GrayWhite; +constexpr KDColor Palette::GrayBright; +constexpr KDColor Palette::GrayMiddle; +constexpr KDColor Palette::GrayDark; +constexpr KDColor Palette::GrayVeryDark; constexpr KDColor Palette::Select; constexpr KDColor Palette::SelectDark; constexpr KDColor Palette::WallScreen; @@ -29,7 +29,7 @@ constexpr KDColor Palette::GreenLight; constexpr KDColor Palette::Brown; constexpr KDColor Palette::Purple; constexpr KDColor Palette::Cyan; -constexpr KDColor Palette::BlueishGrey; +constexpr KDColor Palette::BlueishGray; constexpr KDColor Palette::DataColor[]; constexpr KDColor Palette::DataColorLight[]; diff --git a/escher/src/scroll_view_indicator.cpp b/escher/src/scroll_view_indicator.cpp index 536e54d33..3a4ec4bb3 100644 --- a/escher/src/scroll_view_indicator.cpp +++ b/escher/src/scroll_view_indicator.cpp @@ -8,7 +8,7 @@ extern "C" { ScrollViewIndicator::ScrollViewIndicator() : View(), - m_color(Palette::GreyDark), + m_color(Palette::GrayDark), m_margin(Metric::CommonTopMargin) { } @@ -17,7 +17,7 @@ ScrollViewBar::ScrollViewBar() : ScrollViewIndicator(), m_offset(0), m_visibleLength(0), - m_trackColor(Palette::GreyMiddle) + m_trackColor(Palette::GrayMiddle) { } diff --git a/escher/src/switch_view.cpp b/escher/src/switch_view.cpp index b06d51620..e336d30cf 100644 --- a/escher/src/switch_view.cpp +++ b/escher/src/switch_view.cpp @@ -55,7 +55,7 @@ void SwitchView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate switchHalfHeight = k_switchHeight/2; KDColor switchWorkingBuffer[SwitchView::k_switchWidth*SwitchView::k_switchHeight]; - KDColor mainColor = m_state ? Palette::YellowDark : Palette::GreyDark; + KDColor mainColor = m_state ? Palette::YellowDark : Palette::GrayDark; KDRect frame(width - k_switchWidth, heightCenter -switchHalfHeight, k_switchWidth, k_switchHeight); ctx->blendRectWithMask(frame, mainColor, (const uint8_t *)switchMask, switchWorkingBuffer); KDCoordinate onOffX = width - (m_state ? k_onOffSize : k_switchWidth); diff --git a/escher/src/table_cell.cpp b/escher/src/table_cell.cpp index 0740a5630..1bf949448 100644 --- a/escher/src/table_cell.cpp +++ b/escher/src/table_cell.cpp @@ -166,5 +166,5 @@ void TableCell::layoutSubviews(bool force) { void TableCell::drawRect(KDContext * ctx, KDRect rect) const { KDColor backColor = isHighlighted() ? Palette::Select : backgroundColor(); drawInnerRect(ctx, bounds(), backColor); - drawBorderOfRect(ctx, bounds(), Palette::GreyBright); + drawBorderOfRect(ctx, bounds(), Palette::GrayBright); } diff --git a/escher/src/toolbox.cpp b/escher/src/toolbox.cpp index 0066dd4bf..e4848e8bd 100644 --- a/escher/src/toolbox.cpp +++ b/escher/src/toolbox.cpp @@ -30,7 +30,7 @@ void Toolbox::willDisplayCellForIndex(HighlightCell * cell, int index) { MessageTableCellWithMessage * myCell = (MessageTableCellWithMessage *)cell; myCell->setMessage(messageTree->label()); myCell->setAccessoryMessage(messageTree->text()); - myCell->setAccessoryTextColor(Palette::GreyDark); + myCell->setAccessoryTextColor(Palette::GrayDark); return; } MessageTableCell * myCell = (MessageTableCell *)cell; diff --git a/kandinsky/fonts/rasterizer.c b/kandinsky/fonts/rasterizer.c index 967c5457e..5c953f2de 100644 --- a/kandinsky/fonts/rasterizer.c +++ b/kandinsky/fonts/rasterizer.c @@ -204,10 +204,10 @@ int main(int argc, char * argv[]) { fprintf(sourceFile, "static constexpr KDCoordinate glyphWidth = %d;\n\n", glyph_width); fprintf(sourceFile, "static constexpr KDCoordinate glyphHeight = %d;\n\n", glyph_height); - int greyscaleBitsPerPixel = 4; + int grayscaleBitsPerPixel = 4; - int sizeOfUncompressedGlyphBuffer = glyph_width * glyph_height * greyscaleBitsPerPixel/8; - ENSURE(8*sizeOfUncompressedGlyphBuffer == glyph_width * glyph_height * greyscaleBitsPerPixel, "Error: the glyph size (%dx%d@%dbpp) cannot fit in an integral number of bytes", glyph_width, glyph_height, greyscaleBitsPerPixel); + int sizeOfUncompressedGlyphBuffer = glyph_width * glyph_height * grayscaleBitsPerPixel/8; + ENSURE(8*sizeOfUncompressedGlyphBuffer == glyph_width * glyph_height * grayscaleBitsPerPixel, "Error: the glyph size (%dx%d@%dbpp) cannot fit in an integral number of bytes", glyph_width, glyph_height, grayscaleBitsPerPixel); uint8_t * uncompressedGlyphBuffer = (uint8_t *)malloc(sizeOfUncompressedGlyphBuffer); uint16_t glyphDataOffset[NumberOfCodePoints+1]; @@ -225,9 +225,9 @@ int main(int argc, char * argv[]) { for (int x = 0; x < glyph_width; x++) { pixel_t * pixel = (bitmap_image.pixels + (y+characterY)*bitmap_image.width + (x+characterX)); - uint8_t greyscaleValue = (0xFF - pixel->green) >> (8 - greyscaleBitsPerPixel); - accumulator = (accumulator << greyscaleBitsPerPixel) | greyscaleValue; - if (numberOfValuesAccumulated++ == (8/greyscaleBitsPerPixel)-1) { + uint8_t grayscaleValue = (0xFF - pixel->green) >> (8 - grayscaleBitsPerPixel); + accumulator = (accumulator << grayscaleBitsPerPixel) | grayscaleValue; + if (numberOfValuesAccumulated++ == (8/grayscaleBitsPerPixel)-1) { uncompressedGlyphBuffer[uncompressedGlyphBufferIndex++] = accumulator; accumulator = 0; numberOfValuesAccumulated = 0; @@ -261,7 +261,7 @@ int main(int argc, char * argv[]) { size_t initialDataSize = NumberOfCodePoints * glyph_width * glyph_height; fprintf(sourceFile, "/* Rasterized = %5zu bytes (%d glyphs x %d pixels)\n", initialDataSize, NumberOfCodePoints, glyph_width*glyph_height); - fprintf(sourceFile, " * Downsampled = %5lu bytes (1/%d of rasterized)\n", initialDataSize*greyscaleBitsPerPixel/8, 8/greyscaleBitsPerPixel); + fprintf(sourceFile, " * Downsampled = %5lu bytes (1/%d of rasterized)\n", initialDataSize*grayscaleBitsPerPixel/8, 8/grayscaleBitsPerPixel); fprintf(sourceFile, " * Compressed = %5zu bytes (%.2f%% of rasterized) */\n", finalDataSize, 100.0*finalDataSize/initialDataSize); fprintf(sourceFile, "static constexpr uint8_t glyphData[%d] = {", lastOffset); diff --git a/kandinsky/include/kandinsky/font.h b/kandinsky/include/kandinsky/font.h index 68905120b..a405370f3 100644 --- a/kandinsky/include/kandinsky/font.h +++ b/kandinsky/include/kandinsky/font.h @@ -42,10 +42,10 @@ public: public: GlyphBuffer() {} // Don't initialize either buffer KDColor * colorBuffer() { return m_colors; } - uint8_t * greyscaleBuffer() { return m_greyscales; } - uint8_t * secondaryGreyscaleBuffer() { return m_greyscales + k_maxGlyphPixelCount; } + uint8_t * grayscaleBuffer() { return m_grayscales; } + uint8_t * secondaryGrayscaleBuffer() { return m_grayscales + k_maxGlyphPixelCount; } private: - uint8_t m_greyscales[2*k_maxGlyphPixelCount]; + uint8_t m_grayscales[2*k_maxGlyphPixelCount]; KDColor m_colors[k_maxGlyphPixelCount]; }; @@ -62,8 +62,8 @@ public: static constexpr GlyphIndex IndexForReplacementCharacterCodePoint = 133; GlyphIndex indexForCodePoint(CodePoint c) const; - void setGlyphGreyscalesForCodePoint(CodePoint codePoint, GlyphBuffer * glyphBuffer) const; - void accumulateGlyphGreyscalesForCodePoint(CodePoint codePoint, GlyphBuffer * glyphBuffer) const; + void setGlyphGrayscalesForCodePoint(CodePoint codePoint, GlyphBuffer * glyphBuffer) const; + void accumulateGlyphGrayscalesForCodePoint(CodePoint codePoint, GlyphBuffer * glyphBuffer) const; using RenderPalette = KDPalette<(1<; void colorizeGlyphBuffer(const RenderPalette * renderPalette, GlyphBuffer * glyphBuffer) const; @@ -76,7 +76,7 @@ public: constexpr KDFont(size_t tableLength, const CodePointIndexPair * table, KDCoordinate glyphWidth, KDCoordinate glyphHeight, const uint16_t * glyphDataOffset, const uint8_t * data) : m_tableLength(tableLength), m_table(table), m_glyphSize(glyphWidth, glyphHeight), m_glyphDataOffset(glyphDataOffset), m_data(data) { } private: - void fetchGreyscaleGlyphAtIndex(GlyphIndex index, uint8_t * greyscaleBuffer) const; + void fetchGrayscaleGlyphAtIndex(GlyphIndex index, uint8_t * grayscaleBuffer) const; const uint8_t * compressedGlyphData(GlyphIndex index) const { return m_data + m_glyphDataOffset[index]; diff --git a/kandinsky/src/context_text.cpp b/kandinsky/src/context_text.cpp index 2295274a1..8f36b6247 100644 --- a/kandinsky/src/context_text.cpp +++ b/kandinsky/src/context_text.cpp @@ -35,10 +35,10 @@ KDPoint KDContext::pushOrPullString(const char * text, KDPoint p, const KDFont * codePoint = decoder.nextCodePoint(); } else { assert(!codePoint.isCombining()); - font->setGlyphGreyscalesForCodePoint(codePoint, &glyphBuffer); + font->setGlyphGrayscalesForCodePoint(codePoint, &glyphBuffer); codePoint = decoder.nextCodePoint(); while (codePoint.isCombining()) { - font->accumulateGlyphGreyscalesForCodePoint(codePoint, &glyphBuffer); + font->accumulateGlyphGrayscalesForCodePoint(codePoint, &glyphBuffer); codePointPointer = decoder.stringPosition(); codePoint = decoder.nextCodePoint(); } diff --git a/kandinsky/src/font.cpp b/kandinsky/src/font.cpp index abc44e7cf..ce4fb81fd 100644 --- a/kandinsky/src/font.cpp +++ b/kandinsky/src/font.cpp @@ -33,51 +33,51 @@ KDSize KDFont::stringSizeUntil(const char * text, const char * limit) const { return stringSize; } -void KDFont::setGlyphGreyscalesForCodePoint(CodePoint codePoint, GlyphBuffer * glyphBuffer) const { - fetchGreyscaleGlyphAtIndex(indexForCodePoint(codePoint), glyphBuffer->greyscaleBuffer()); +void KDFont::setGlyphGrayscalesForCodePoint(CodePoint codePoint, GlyphBuffer * glyphBuffer) const { + fetchGrayscaleGlyphAtIndex(indexForCodePoint(codePoint), glyphBuffer->grayscaleBuffer()); } -void KDFont::accumulateGlyphGreyscalesForCodePoint(CodePoint codePoint, GlyphBuffer * glyphBuffer) const { - uint8_t * greyscaleBuffer = glyphBuffer->greyscaleBuffer(); - uint8_t * accumulationGreyscaleBuffer = glyphBuffer->secondaryGreyscaleBuffer(); - fetchGreyscaleGlyphAtIndex(indexForCodePoint(codePoint), accumulationGreyscaleBuffer); +void KDFont::accumulateGlyphGrayscalesForCodePoint(CodePoint codePoint, GlyphBuffer * glyphBuffer) const { + uint8_t * grayscaleBuffer = glyphBuffer->grayscaleBuffer(); + uint8_t * accumulationGrayscaleBuffer = glyphBuffer->secondaryGrayscaleBuffer(); + fetchGrayscaleGlyphAtIndex(indexForCodePoint(codePoint), accumulationGrayscaleBuffer); for (int i=0; igreyscaleBuffer(); + uint8_t * grayscaleBuffer = glyphBuffer->grayscaleBuffer(); KDColor * colorBuffer = glyphBuffer->colorBuffer(); uint8_t mask = (0xFF >> (8-k_bitsPerPixel)); int pixelIndex = m_glyphSize.width() * m_glyphSize.height() - 1; // Let's start at the final pixel - int greyscaleByteIndex = pixelIndex * k_bitsPerPixel / 8; + int grayscaleByteIndex = pixelIndex * k_bitsPerPixel / 8; while (pixelIndex >= 0) { - assert(greyscaleByteIndex == pixelIndex * k_bitsPerPixel / 8); - uint8_t greyscaleByte = greyscaleBuffer[greyscaleByteIndex--]; // We consume a greyscale byte... + assert(grayscaleByteIndex == pixelIndex * k_bitsPerPixel / 8); + uint8_t grayscaleByte = grayscaleBuffer[grayscaleByteIndex--]; // We consume a grayscale byte... for (int j=0; j<8/k_bitsPerPixel; j++) { // .. and we'll output 8/k_bits pixels - uint8_t greyscale = greyscaleByte & mask; - greyscaleByte = greyscaleByte >> k_bitsPerPixel; + uint8_t grayscale = grayscaleByte & mask; + grayscaleByte = grayscaleByte >> k_bitsPerPixel; assert(pixelIndex >= 0); - colorBuffer[pixelIndex--] = renderPalette->colorAtIndex(greyscale); + colorBuffer[pixelIndex--] = renderPalette->colorAtIndex(grayscale); } } } diff --git a/poincare/include/poincare/empty_layout.h b/poincare/include/poincare/empty_layout.h index 8edb9c538..c55270696 100644 --- a/poincare/include/poincare/empty_layout.h +++ b/poincare/include/poincare/empty_layout.h @@ -10,7 +10,7 @@ class EmptyLayoutNode /*final*/ : public LayoutNode { public: enum class Color { Yellow, - Grey + Gray }; // Layout diff --git a/poincare/include/poincare/layout.h b/poincare/include/poincare/layout.h index d2603139a..96d49ec58 100644 --- a/poincare/include/poincare/layout.h +++ b/poincare/include/poincare/layout.h @@ -60,9 +60,9 @@ public: // Layout modification void deleteBeforeCursor(LayoutCursor * cursor) { return node()->deleteBeforeCursor(cursor); } - bool removeGreySquaresFromAllMatrixAncestors() { return node()->removeGreySquaresFromAllMatrixAncestors(); } - bool removeGreySquaresFromAllMatrixChildren() { return node()->removeGreySquaresFromAllMatrixChildren(); } - bool addGreySquaresToAllMatrixAncestors() { return node()->addGreySquaresToAllMatrixAncestors(); } + bool removeGraySquaresFromAllMatrixAncestors() { return node()->removeGraySquaresFromAllMatrixAncestors(); } + bool removeGraySquaresFromAllMatrixChildren() { return node()->removeGraySquaresFromAllMatrixChildren(); } + bool addGraySquaresToAllMatrixAncestors() { return node()->addGraySquaresToAllMatrixAncestors(); } Layout layoutToPointWhenInserting(Expression * correspondingExpression) { // Pointer to correspondingExpr because expression.h includes layout.h assert(correspondingExpression != nullptr); diff --git a/poincare/include/poincare/layout_node.h b/poincare/include/poincare/layout_node.h index afad9aae1..a6a0f670f 100644 --- a/poincare/include/poincare/layout_node.h +++ b/poincare/include/poincare/layout_node.h @@ -103,9 +103,9 @@ public: // Other virtual LayoutNode * layoutToPointWhenInserting(Expression * correspondingExpression); - bool removeGreySquaresFromAllMatrixAncestors(); - bool removeGreySquaresFromAllMatrixChildren(); - bool addGreySquaresToAllMatrixAncestors(); + bool removeGraySquaresFromAllMatrixAncestors(); + bool removeGraySquaresFromAllMatrixChildren(); + bool addGraySquaresToAllMatrixAncestors(); /* A layout has text if it is not empty and it is not an horizontal layout * with no child or with one child with no text. */ virtual bool hasText() const { return true; } @@ -173,7 +173,7 @@ private: int * resultScore, bool forSelection); virtual void render(KDContext * ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor, Layout * selectionStart = nullptr, Layout * selectionEnd = nullptr, KDColor selectionColor = KDColorRed) = 0; - void changeGreySquaresOfAllMatrixRelatives(bool add, bool ancestors, bool * changedSquares); + void changeGraySquaresOfAllMatrixRelatives(bool add, bool ancestors, bool * changedSquares); }; } diff --git a/poincare/include/poincare/matrix_layout.h b/poincare/include/poincare/matrix_layout.h index 6cded4cee..31757b206 100644 --- a/poincare/include/poincare/matrix_layout.h +++ b/poincare/include/poincare/matrix_layout.h @@ -19,8 +19,8 @@ public: Type type() const override { return Type::MatrixLayout; } // MatrixLayoutNode - void addGreySquares(); - void removeGreySquares(); + void addGraySquares(); + void removeGraySquares(); // LayoutNode void moveCursorLeft(LayoutCursor * cursor, bool * shouldRecomputeLayout, bool forSelection) override; @@ -50,7 +50,7 @@ private: void newRowOrColumnAtIndex(int index); bool isRowEmpty(int index) const; bool isColumnEmpty(int index) const; - bool hasGreySquares() const; + bool hasGraySquares() const; // LayoutNode void render(KDContext * ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor, Layout * selectionStart = nullptr, Layout * selectionEnd = nullptr, KDColor selectionColor = KDColorRed) override; @@ -64,9 +64,9 @@ public: static MatrixLayout Builder() { return TreeHandle::NAryBuilder(); } static MatrixLayout Builder(Layout l1, Layout l2, Layout l3, Layout l4); - bool hasGreySquares() const { return node()->hasGreySquares(); } - void addGreySquares() { node()->addGreySquares(); } - void removeGreySquares() { node()->removeGreySquares(); } + bool hasGraySquares() const { return node()->hasGraySquares(); } + void addGraySquares() { node()->addGraySquares(); } + void removeGraySquares() { node()->removeGraySquares(); } private: MatrixLayoutNode * node() const { return static_cast(Layout::node()); } }; diff --git a/poincare/src/empty_layout.cpp b/poincare/src/empty_layout.cpp index bb9582856..e937767c8 100644 --- a/poincare/src/empty_layout.cpp +++ b/poincare/src/empty_layout.cpp @@ -68,7 +68,7 @@ void EmptyLayoutNode::moveCursorVertically(VerticalDirection direction, LayoutCu bool EmptyLayoutNode::willAddSibling(LayoutCursor * cursor, LayoutNode * sibling, bool moveCursor) { EmptyLayout thisRef(this); Layout siblingRef(sibling); // Create the reference now, as the node might be moved - if (m_color == Color::Grey) { + if (m_color == Color::Gray) { /* The parent is a MatrixLayout, and the current empty row or column is * being filled in, so add a new empty row or column. */ LayoutNode * parentNode = parent(); @@ -88,7 +88,7 @@ bool EmptyLayoutNode::willAddSibling(LayoutCursor * cursor, LayoutNode * sibling void EmptyLayoutNode::render(KDContext * ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor, Layout * selectionStart, Layout * selectionEnd, KDColor selectionColor) { if (m_isVisible) { - KDColor fillColor = m_color == Color::Yellow ? Palette::YellowDark : Palette::GreyBright; + KDColor fillColor = m_color == Color::Yellow ? Palette::YellowDark : Palette::GrayBright; ctx->fillRect(KDRect(p.x()+(m_margins ? k_marginWidth : 0), p.y()+(m_margins ? k_marginHeight : 0), width(), height()), fillColor); ctx->fillRect(KDRect(p.x()+(m_margins ? k_marginWidth : 0), p.y()+(m_margins ? k_marginHeight : 0), width(), height()), fillColor); } diff --git a/poincare/src/layout_cursor.cpp b/poincare/src/layout_cursor.cpp index a8998f6d4..d77e152c3 100644 --- a/poincare/src/layout_cursor.cpp +++ b/poincare/src/layout_cursor.cpp @@ -150,9 +150,9 @@ void LayoutCursor::addEmptyExponentialLayout() { void LayoutCursor::addEmptyMatrixLayout() { MatrixLayout matrixLayout = MatrixLayout::Builder( EmptyLayout::Builder(EmptyLayoutNode::Color::Yellow), - EmptyLayout::Builder(EmptyLayoutNode::Color::Grey), - EmptyLayout::Builder(EmptyLayoutNode::Color::Grey), - EmptyLayout::Builder(EmptyLayoutNode::Color::Grey)); + EmptyLayout::Builder(EmptyLayoutNode::Color::Gray), + EmptyLayout::Builder(EmptyLayoutNode::Color::Gray), + EmptyLayout::Builder(EmptyLayoutNode::Color::Gray)); m_layout.addSibling(this, matrixLayout, false); m_layout = matrixLayout.childAtIndex(0); m_position = Position::Right; @@ -432,7 +432,7 @@ void LayoutCursor::selectUpDown(bool up, bool * shouldRecomputeLayout, Layout * * position). This ancestor will be the added selection. * * The current layout might have been detached from its parent, for instance - * if it was a grey empty layout of a matrix and the cursor move exited this + * if it was a gray empty layout of a matrix and the cursor move exited this * matrix. In this case, use the layout parent (it should still be attached to * the main layout). */ diff --git a/poincare/src/layout_node.cpp b/poincare/src/layout_node.cpp index 6058df3f2..84b001496 100644 --- a/poincare/src/layout_node.cpp +++ b/poincare/src/layout_node.cpp @@ -118,21 +118,21 @@ LayoutNode * LayoutNode::layoutToPointWhenInserting(Expression * correspondingEx return numberOfChildren() > 0 ? childAtIndex(0) : this; } -bool LayoutNode::removeGreySquaresFromAllMatrixAncestors() { +bool LayoutNode::removeGraySquaresFromAllMatrixAncestors() { bool result = false; - changeGreySquaresOfAllMatrixRelatives(false, true, &result); + changeGraySquaresOfAllMatrixRelatives(false, true, &result); return result; } -bool LayoutNode::removeGreySquaresFromAllMatrixChildren() { +bool LayoutNode::removeGraySquaresFromAllMatrixChildren() { bool result = false; - changeGreySquaresOfAllMatrixRelatives(false, false, &result); + changeGraySquaresOfAllMatrixRelatives(false, false, &result); return result; } -bool LayoutNode::addGreySquaresToAllMatrixAncestors() { +bool LayoutNode::addGraySquaresToAllMatrixAncestors() { bool result = false; - changeGreySquaresOfAllMatrixRelatives(true, true, &result); + changeGraySquaresOfAllMatrixRelatives(true, true, &result); return result; } @@ -215,7 +215,7 @@ void LayoutNode::moveCursorInDescendantsVertically(VerticalDirection direction, // If there is a valid result Layout resultRef(childResult); if ((*childResultPtr) != nullptr) { - *shouldRecomputeLayout = childResult->addGreySquaresToAllMatrixAncestors(); + *shouldRecomputeLayout = childResult->addGraySquaresToAllMatrixAncestors(); // WARNING: Do not use "this" afterwards } cursor->setLayout(resultRef); @@ -260,36 +260,36 @@ void LayoutNode::scoreCursorInDescendantsVertically ( } } -bool addRemoveGreySquaresInLayoutIfNeeded(bool add, Layout * l) { +bool addRemoveGraySquaresInLayoutIfNeeded(bool add, Layout * l) { if (l->type() != LayoutNode::Type::MatrixLayout) { return false; } if (add) { - static_cast(l->node())->addGreySquares(); + static_cast(l->node())->addGraySquares(); } else { - static_cast(l->node())->removeGreySquares(); + static_cast(l->node())->removeGraySquares(); } return true; } -void LayoutNode::changeGreySquaresOfAllMatrixRelatives(bool add, bool ancestors, bool * changedSquares) { +void LayoutNode::changeGraySquaresOfAllMatrixRelatives(bool add, bool ancestors, bool * changedSquares) { if (!ancestors) { // If in children, we also change the squares for this { Layout thisLayout = Layout(this); - if (addRemoveGreySquaresInLayoutIfNeeded(add, &thisLayout)) { + if (addRemoveGraySquaresInLayoutIfNeeded(add, &thisLayout)) { *changedSquares = true; } } for (int i = 0; i < numberOfChildren(); i++) { /* We cannot use "for l : children()", as the node addresses might change, * especially the iterator stopping address. */ - childAtIndex(i)->changeGreySquaresOfAllMatrixRelatives(add, false, changedSquares); + childAtIndex(i)->changeGraySquaresOfAllMatrixRelatives(add, false, changedSquares); } } else { Layout currentAncestor = Layout(parent()); while (!currentAncestor.isUninitialized()) { - if (addRemoveGreySquaresInLayoutIfNeeded(add, ¤tAncestor)) { + if (addRemoveGraySquaresInLayoutIfNeeded(add, ¤tAncestor)) { *changedSquares = true; } currentAncestor = currentAncestor.parent(); diff --git a/poincare/src/matrix_layout.cpp b/poincare/src/matrix_layout.cpp index bb1b05a01..e946fe98a 100644 --- a/poincare/src/matrix_layout.cpp +++ b/poincare/src/matrix_layout.cpp @@ -10,16 +10,16 @@ namespace Poincare { // MatrixLayoutNode -void MatrixLayoutNode::addGreySquares() { - if (!hasGreySquares()) { +void MatrixLayoutNode::addGraySquares() { + if (!hasGraySquares()) { Layout thisRef(this); - addEmptyRow(EmptyLayoutNode::Color::Grey); - addEmptyColumn(EmptyLayoutNode::Color::Grey); + addEmptyRow(EmptyLayoutNode::Color::Gray); + addEmptyColumn(EmptyLayoutNode::Color::Gray); } } -void MatrixLayoutNode::removeGreySquares() { - if (hasGreySquares()) { +void MatrixLayoutNode::removeGraySquares() { + if (hasGraySquares()) { deleteRowAtIndex(m_numberOfRows - 1); deleteColumnAtIndex(m_numberOfColumns - 1); } @@ -33,10 +33,10 @@ void MatrixLayoutNode::moveCursorLeft(LayoutCursor * cursor, bool * shouldRecomp && cursor->position() == LayoutCursor::Position::Left && childIsLeftOfGrid(childIndex)) { - /* Case: Left of a child on the left of the grid. Remove the grey squares of + /* Case: Left of a child on the left of the grid. Remove the gray squares of * the grid, then go left of the grid. */ - assert(hasGreySquares()); - removeGreySquares(); + assert(hasGraySquares()); + removeGraySquares(); *shouldRecomputeLayout = true; cursor->setLayoutNode(this); return; @@ -44,10 +44,10 @@ void MatrixLayoutNode::moveCursorLeft(LayoutCursor * cursor, bool * shouldRecomp if (cursor->layoutNode() == this && cursor->position() == LayoutCursor::Position::Right) { - /* Case: Right. Add the grey squares to the matrix, then move to the bottom - * right non empty nor grey child. */ - assert(!hasGreySquares()); - addGreySquares(); + /* Case: Right. Add the gray squares to the matrix, then move to the bottom + * right non empty nor gray child. */ + assert(!hasGraySquares()); + addGraySquares(); *shouldRecomputeLayout = true; LayoutNode * lastChild = childAtIndex((m_numberOfColumns-1)*(m_numberOfRows-1)); cursor->setLayoutNode(lastChild); @@ -60,9 +60,9 @@ void MatrixLayoutNode::moveCursorRight(LayoutCursor * cursor, bool * shouldRecom if (cursor->layoutNode() == this && cursor->position() == LayoutCursor::Position::Left) { - // Case: Left. Add grey squares to the matrix, then go to its first entry. - assert(!hasGreySquares()); - addGreySquares(); + // Case: Left. Add gray squares to the matrix, then go to its first entry. + assert(!hasGraySquares()); + addGraySquares(); *shouldRecomputeLayout = true; assert(m_numberOfColumns*m_numberOfRows >= 1); cursor->setLayoutNode(childAtIndex(0)); @@ -73,10 +73,10 @@ void MatrixLayoutNode::moveCursorRight(LayoutCursor * cursor, bool * shouldRecom && cursor->position() == LayoutCursor::Position::Right && childIsRightOfGrid(childIndex)) { - /* Case: Right of a child on the right of the grid. Remove the grey squares + /* Case: Right of a child on the right of the grid. Remove the gray squares * of the grid, then go right of the grid. */ - assert(hasGreySquares()); - removeGreySquares(); + assert(hasGraySquares()); + removeGraySquares(); *shouldRecomputeLayout = true; cursor->setLayoutNode(this); return; @@ -149,7 +149,7 @@ int MatrixLayoutNode::serialize(char * buffer, int bufferSize, Preferences::Prin } // Serialize the vectors - int maxColumnIndex = hasGreySquares() ? m_numberOfColumns - 2 : m_numberOfColumns - 1; + int maxColumnIndex = hasGraySquares() ? m_numberOfColumns - 2 : m_numberOfColumns - 1; for (int i = minRowIndex; i <= maxRowIndex; i++) { numberOfChar += SerializationHelper::CodePoint(buffer + numberOfChar, bufferSize - numberOfChar, '['); if (numberOfChar >= bufferSize-1) { return bufferSize-1;} @@ -183,7 +183,7 @@ KDPoint MatrixLayoutNode::positionOfChild(LayoutNode * l) { void MatrixLayoutNode::moveCursorVertically(VerticalDirection direction, LayoutCursor * cursor, bool * shouldRecomputeLayout, bool equivalentPositionVisited, bool forSelection) { MatrixLayout thisRef = MatrixLayout(this); - bool shouldRemoveGreySquares = false; + bool shouldRemoveGraySquares = false; int firstIndex = direction == VerticalDirection::Up ? 0 : numberOfChildren() - m_numberOfColumns; int lastIndex = direction == VerticalDirection::Up ? m_numberOfColumns : numberOfChildren(); int i = firstIndex; @@ -192,16 +192,16 @@ void MatrixLayoutNode::moveCursorVertically(VerticalDirection direction, LayoutC break; } if (cursor->layout().node()->hasAncestor(l, true)) { - // The cursor is leaving the matrix, so remove the grey squares. - shouldRemoveGreySquares = true; + // The cursor is leaving the matrix, so remove the gray squares. + shouldRemoveGraySquares = true; break; } i++; } GridLayoutNode::moveCursorVertically(direction, cursor, shouldRecomputeLayout, equivalentPositionVisited, forSelection); - if (cursor->isDefined() && shouldRemoveGreySquares) { - assert(thisRef.hasGreySquares()); - thisRef.removeGreySquares(); + if (cursor->isDefined() && shouldRemoveGraySquares) { + assert(thisRef.hasGraySquares()); + thisRef.removeGraySquares(); *shouldRecomputeLayout = true; } } @@ -214,7 +214,7 @@ void MatrixLayoutNode::newRowOrColumnAtIndex(int index) { int correspondingRow = rowAtChildIndex(index); if (childIsRightOfGrid(index)) { assert(m_numberOfRows >= 2); - // Color the grey EmptyLayouts of the column in yellow. + // Color the gray EmptyLayouts of the column in yellow. int correspondingColumn = m_numberOfColumns - 1; int childIndex = correspondingColumn; int maxIndex = (m_numberOfRows - 2)*m_numberOfColumns+correspondingColumn; @@ -234,12 +234,12 @@ void MatrixLayoutNode::newRowOrColumnAtIndex(int index) { } childIndex++; } - // Add a column of grey EmptyLayouts on the right. - addEmptyColumn(EmptyLayoutNode::Color::Grey); + // Add a column of gray EmptyLayouts on the right. + addEmptyColumn(EmptyLayoutNode::Color::Gray); } if (shouldAddNewRow) { assert(m_numberOfColumns >= 2); - // Color the grey EmptyLayouts of the row in yellow. + // Color the gray EmptyLayouts of the row in yellow. int childIndex = correspondingRow * m_numberOfColumns; int maxIndex = correspondingRow * m_numberOfColumns + m_numberOfColumns - 2; for (LayoutNode * lastLayoutOfColumn : childrenFromIndex(correspondingRow*m_numberOfColumns)) { @@ -256,8 +256,8 @@ void MatrixLayoutNode::newRowOrColumnAtIndex(int index) { } childIndex++; } - // Add a row of grey EmptyLayouts at the bottom. - addEmptyRow(EmptyLayoutNode::Color::Grey); + // Add a row of gray EmptyLayouts at the bottom. + addEmptyRow(EmptyLayoutNode::Color::Gray); } } @@ -291,14 +291,14 @@ bool MatrixLayoutNode::isColumnEmpty(int index) const { return true; } -bool MatrixLayoutNode::hasGreySquares() const { +bool MatrixLayoutNode::hasGraySquares() const { if (numberOfChildren() == 0) { return false; } LayoutNode * lastChild = const_cast(this)->childAtIndex(m_numberOfRows * m_numberOfColumns - 1); if (lastChild->isEmpty() && lastChild->type() != Type::HorizontalLayout - && (static_cast(lastChild))->color() == EmptyLayoutNode::Color::Grey) + && (static_cast(lastChild))->color() == EmptyLayoutNode::Color::Gray) { assert(isRowEmpty(m_numberOfRows - 1)); assert(isColumnEmpty(m_numberOfColumns - 1)); diff --git a/python/port/port.cpp b/python/port/port.cpp index 1a4eb61df..9a73bd4b9 100644 --- a/python/port/port.cpp +++ b/python/port/port.cpp @@ -201,10 +201,10 @@ KDColor MicroPython::Color::Parse(mp_obj_t input, Mode mode){ NamedColor("pink", Palette::Pink), NamedColor("orange", Palette::Orange), NamedColor("purple", Palette::Purple), - NamedColor("grey", Palette::GreyDark), + NamedColor("gray", Palette::GrayDark), NamedColor("cyan", Palette::Cyan), NamedColor("magenta", Palette::Magenta) - }; +}; for (NamedColor p : pairs) { if (strcmp(p.name(), color) == 0) { return p.color(); @@ -220,12 +220,12 @@ KDColor MicroPython::Color::Parse(mp_obj_t input, Mode mode){ return KDColor::RGB24(colorInt); } - mp_float_t greyLevel = mp_obj_float_get(mp_parse_num_decimal(color, strlen(color), false, false, NULL)); - if (greyLevel >= 0.0 && greyLevel <= 1.0) { - uint8_t color = maxColorIntensity * (float) greyLevel; + mp_float_t grayLevel = mp_obj_float_get(mp_parse_num_decimal(color, strlen(color), false, false, NULL)); + if (grayLevel >= 0.0 && grayLevel <= 1.0) { + uint8_t color = maxColorIntensity * (float) grayLevel; return KDColor::RGB888(color, color, color); } - mp_raise_ValueError("Grey levels are between 0.0 and 1.0"); + mp_raise_ValueError("Gray levels are between 0.0 and 1.0"); } else if(mp_obj_is_int(input)) { mp_raise_TypeError("Int are not colors"); //See https://github.com/numworks/epsilon/issues/1533#issuecomment-618443492