General query on marriages.

@param string|null $color_from
@param string|null $color_to

@return string
196721
public function statsMarr(string $color_from = null, string $color_to = null): string
    {
        return (new ChartMarriage($this->tree))
            ->chartMarriage($color_from, $color_to);
    }
776252
public static int cusparseScsrcolor(
        cusparseHandle handle, 
        int m, 
        int nnz, 
        cusparseMatDescr descrA, 
        Pointer csrSortedValA, 
        Pointer csrSortedRowPtrA, 
        Pointer csrSortedColIndA, 
        Pointer fractionToColor, 
        Pointer ncolors, 
        Pointer coloring, 
        Pointer reordering, 
        cusparseColorInfo info)
    {
        return checkResult(cusparseScsrcolorNative(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, fractionToColor, ncolors, coloring, reordering, info));
    }
1321257
public T setFillColor(final IColor color)
    {
        return setFillColor(null == color ? null : color.getColorString());
    }
860531
public final BooleanExpression between(@Nullable T from, @Nullable T to) {
        if (from == null) {
            if (to != null) {
                return Expressions.booleanOperation(Ops.LOE, mixin, ConstantImpl.create(to));
            } else {
                throw new IllegalArgumentException("Either from or to needs to be non-null");
            }
        } else if (to == null) {
            return Expressions.booleanOperation(Ops.GOE, mixin, ConstantImpl.create(from));
        } else {
            return Expressions.booleanOperation(Ops.BETWEEN, mixin, ConstantImpl.create(from), ConstantImpl.create(to));
        }
    }
184360
public static function fromRGBString($color)
    {
        $color = rtrim($color, "rgb (\t)");
        $rgb = preg_split('\s+,\s+', $color);

        $c = new self();
        list($c->r, $c->g, $c->b) = array_map('intval', $rgb);

        return $c;
    }
1048132
public ColorRecord getColorRecord (int classId, int colorId)
    {
        ClassRecord record = getClassRecord(classId);
        if (record == null) {
            // if they request color class zero, we assume they're just
            // decoding a blank colorprint, otherwise we complain
            if (classId != 0) {
                log.warning("Requested unknown color class",
                    "classId", classId, "colorId", colorId, new Exception());
            }
            return null;
        }
        return record.colors.get(colorId);
    }
163125
public static String getSolrRangeString(String from, String to) {

        // If a parameter is not initialized, use the asterisk '*' operator
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(from)) {
            from = "*";
        }

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(to)) {
            to = "*";
        }

        return String.format("[%s TO %s]", from, to);
    }
903240
@CheckReturnValue
    public RoleAction setColor(Color color)
    {
        return this.setColor(color != null ? color.getRGB() : null);
    }
711504
function fromNamed(color) {
  const el = document.createElement('div');
  el.style.color = color;
  if (el.style.color !== '') {
    document.body.appendChild(el);
    const rgb = getComputedStyle(el).color;
    document.body.removeChild(el);
    return rgb;
  } else {
    return '';
  }
}
909296
public function statsBirth(string $color_from = null, string $color_to = null): string
    {
        return (new ChartBirth($this->tree))
            ->chartBirth($color_from, $color_to);
    }
73551
public function chartCommonGiven(
        int $tot_indi,
        array $given,
        string $color_from = null,
        string $color_to = null
    ) : string {
        $chart_color1 = (string) $this->theme->parameter('distribution-chart-no-values');
        $chart_color2 = (string) $this->theme->parameter('distribution-chart-high-values');
        $color_from   = $color_from ?? $chart_color1;
        $color_to     = $color_to   ?? $chart_color2;

        $tot = 0;
        foreach ($given as $count) {
            $tot += $count;
        }

        $data = [
            [
                I18N::translate('Name'),
                I18N::translate('Total')
            ],
        ];

        foreach ($given as $name => $count) {
            $data[] = [ $name, $count ];
        }

        $data[] = [
            I18N::translate('Other'),
            $tot_indi - $tot
        ];

        $colors = $this->color_service->interpolateRgb($color_from, $color_to, count($data) - 1);

        return view(
            'statistics/other/charts/pie',
            [
                'title'  => null,
                'data'   => $data,
                'colors' => $colors,
            ]
        );
    }
37999
private static function readColor($color, $palette, $version)
    {
        if ($color <= 0x07 || $color >= 0x40) {
            // special built-in color
            return self::mapBuiltInColor($color);
        } elseif (isset($palette) && isset($palette[$color - 8])) {
            // palette color, color index 0x08 maps to pallete index 0
            return $palette[$color - 8];
        } else {
            // default color table
            if ($version == self::XLS_BIFF8) {
                return self::mapColor($color);
            } else {
                // BIFF5
                return self::mapColorBIFF5($color);
            }
        }

        return $color;
    }
298175
public function chartLargestFamilies(
        string $color_from = null,
        string $color_to = null,
        int    $total = 10
    ): string {
        $chart_color1 = (string) $this->theme->parameter('distribution-chart-no-values');
        $chart_color2 = (string) $this->theme->parameter('distribution-chart-high-values');
        $color_from   = $color_from ?? $chart_color1;
        $color_to     = $color_to   ?? $chart_color2;

        $data = [
            [
                I18N::translate('Type'),
                I18N::translate('Total')
            ],
        ];

        foreach ($this->queryRecords($total) as $record) {
            $family = Family::getInstance($record->id, $this->tree);

            if ($family && $family->canShow()) {
                $data[] = [
                    htmlspecialchars_decode(strip_tags($family->fullName())),
                    $record->total
                ];
            }
        }

        $colors = $this->color_service->interpolateRgb($color_from, $color_to, count($data) - 1);

        return view(
            'statistics/other/charts/pie',
            [
                'title'       => I18N::translate('Largest families'),
                'data'        => $data,
                'colors'      => $colors,
            ]
        );
    }
532046
public function getAnswerPosts($from = null, $to = null)
    {
        $answerPosts = array(
            'posts_per_page' => -1,
            'post_type' => 'customer-feedback',
            'post_status' => array('publish', 'pending', 'draft'),
        );

        $answerPosts['date_query'] = array(
            'inclusive' => true
        );

        if (!is_null($from)) {
            $answerPosts['date_query']['after'] = $from;
        }

        if (!is_null($to)) {
            $answerPosts['date_query']['before'] = $to;
        }

        $answerPosts = new \WP_Query($answerPosts);
        return $answerPosts->posts;
    }
931963
public function renderReport($from = null, $to = null, $return = false)
    {
        // Get dates from querystring
        if (isset($_GET['date_from']) && !empty($_GET['date_from'])) {
            $from = $_GET['date_from'];
        }

        if (isset($_GET['date_to']) && !empty($_GET['date_to'])) {
            $to = $_GET['date_to'];
        }

        if (isset($_GET['date']) && !empty($_GET['date'])) {
            $to = $_GET['date'];
            $from = $_GET['date'];
        }

        // Fallback to last week
        if (empty($from) && empty($to)) {
            $from = date('Y-m-d', strtotime('-1 week'));
            $to = date('Y-m-d');
        }

        // Get data from dates
        $data = $this->getDataBetween($from, $to);

        // Get question
        $mainQuestion = __('Did the information on this page help you?', 'customer-feedback');
        if (!empty(get_field('customer_feedback_main_question_text', 'option'))) {
            $mainQuestion = get_field('customer_feedback_main_question_text', 'option');
        }

        $mainQuestionSub = __('Answer the question to help us improve our information.', 'customer-feedback');
        if (function_exists('get_field') && !empty(get_field('customer_feedback_main_question_sub', 'option'))) {
            $mainQuestionSub = get_field('customer_feedback_main_question_sub', 'option');
        }

        // Render view
        if ($return) {
            ob_start();
            include CUSTOMERFEEDBACK_TEMPLATE_PATH . '/summary-view.php';
            return ob_get_clean();
        } else {
            include CUSTOMERFEEDBACK_TEMPLATE_PATH . '/summary-view.php';
        }
    }
310576
public static TranslatableComponent of(final @NonNull String key, final @Nullable TextColor color) {
    return builder(key)
      .color(color)
      .build();
  }
695263
private static String colorString(Color color) {
		return color.getRed() + "," + color.getGreen() + "," + color.getBlue()
				+ "," + color.getAlpha();
	}