color

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 1.0, Creation date: 2012-06-08, Last change: 2025-09-14

generates a colorvector from the colorchar



See Also: SGshowcolors , VLcol , colofn

Example Illustration

 missing image of color(c)

Syntax

cm=color(c)

Input Parameter

c: color" r y m c g b w k'

Output Parameter

cm: index to colormap VLcol

Examples

Set colormap for green
color('y')
colormap (color('g'));
caxis ([0 7]);




Copyright 2012-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, named color, is designed to generate a color index from a given color character. It is part of the SG-Library and was created by Tim Lueth in 2012.

Input Parameters

Output Results

Algorithm Steps

  1. Define a string cmap containing the characters 'k', 'b', 'g', 'c', 'r', 'm', 'y'.
  2. Check if the input c is numeric. If it is, set cm to c and return.
  3. Use a switch statement to determine the index cm based on the input character c:
  4. If there are no output arguments (nargout==0), perform the following visualization steps:
Algorithm explaination created using ChatGPT on 2025-08-18 23:29. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21