Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Formatting tweaks per clang-format patch
  • Loading branch information
owenfromcanada committed Jun 20, 2025
commit 919fbd7841c2bc0ac13ff80e347ecb374e55fe3d
24 changes: 19 additions & 5 deletions src/displayapp/widgets/Flower.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,25 @@ namespace Pinetime {
static const int NUM_PETAL_COLORS = 8;
static constexpr int CONTAINER_WIDTH = MAX_PETAL_LENGTH * 2 + LINE_WIDTH * 2;

static constexpr uint16_t PETAL_INDEX(uint16_t seed) { return seed & 0x07UL; }
static constexpr uint16_t SIZE_INDEX(uint16_t seed) { return (seed >> 3) & 0x07UL; }
static constexpr uint16_t ANGLE_OFFS_INDEX(uint16_t seed) { return (seed >> 6) & 0x07UL; }
static constexpr uint16_t COLOR_INDEX(uint16_t seed) { return (seed >> 9) % NUM_PETAL_COLORS; }
static constexpr int HEIGHT_FROM_STAGE(int max, int stage) { return stage > 5 ? max * 3 / 4 : max * stage / 5; }
static constexpr uint16_t PETAL_INDEX(uint16_t seed) {
return seed & 0x07UL;
}

static constexpr uint16_t SIZE_INDEX(uint16_t seed) {
return (seed >> 3) & 0x07UL;
}

static constexpr uint16_t ANGLE_OFFS_INDEX(uint16_t seed) {
return (seed >> 6) & 0x07UL;
}

static constexpr uint16_t COLOR_INDEX(uint16_t seed) {
return (seed >> 9) % NUM_PETAL_COLORS;
}

static constexpr int HEIGHT_FROM_STAGE(int max, int stage) {
return stage > 5 ? max * 3 / 4 : max * stage / 5;
}

static constexpr uint32_t PETAL_COLORS[NUM_PETAL_COLORS] =
{0xf43838, 0xf48829, 0xf9f44d, 0x56efe2, 0x6f7afc, 0x8f68f9, 0xdb49fc, 0xfc83b5};
Expand Down