]> git.ktnx.net Git - mobile-ledger.git/commitdiff
use a constant for the color wheel step size
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 5 May 2019 14:07:12 +0000 (17:07 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 5 May 2019 14:07:12 +0000 (17:07 +0300)
tools/gen-styles

index 0e894e9f3cb1028644969c80170ac79172c60c19..d158d8bf370e227e5b9894c9a39b8c02558006dd 100644 (file)
@@ -140,8 +140,10 @@ warn sprintf( 's%1.3f, l%1.3f -> %s',
 
 my $baseTheme = "AppTheme.NoActionBar";
 
 
 my $baseTheme = "AppTheme.NoActionBar";
 
+use constant STEP_DEGREES => 15;
+
 # # hsb
 # # hsb
-# for( my $hue = 0; $hue < 360; $hue += 15 ) {
+# for( my $hue = 0; $hue < 360; $hue += STEP_DEGREES ) {
 #      printf "<style name=\"%s.%d\" parent=\"%s\">\n",
 #              $baseTheme, $hue, $baseTheme;
 #      printf "  <item name=\"colorPrimary\">#%s</item>\n",
 #      printf "<style name=\"%s.%d\" parent=\"%s\">\n",
 #              $baseTheme, $hue, $baseTheme;
 #      printf "  <item name=\"colorPrimary\">#%s</item>\n",
@@ -165,7 +167,7 @@ sub outputThemes {
        my $out = shift;
        my $baseIndent = shift;
        $out->print(hslStyleForHue($baseColorHue, undef, $baseIndent));
        my $out = shift;
        my $baseIndent = shift;
        $out->print(hslStyleForHue($baseColorHue, undef, $baseIndent));
-       for( my $hue = 0; $hue < 360; $hue += 15 ) {
+       for( my $hue = 0; $hue < 360; $hue += STEP_DEGREES ) {
                $out->print("\n");
                $out->print(hslStyleForHue($hue, $baseTheme, $baseIndent));
        }
                $out->print("\n");
                $out->print(hslStyleForHue($hue, $baseTheme, $baseIndent));
        }