Standard colors cannot be used

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #55071
    Support
    Keymaster

      I can make a function for colors converting, like the ColorToRGB function.

      Something named like ColorToSkin(AColor: TColor)… Is this what you meant?

      #55073
      HeDiBo
      Participant
        'Support' wrote:

        I can make a function for colors converting, like the ColorToRGB function.

        Something named like ColorToSkin(AColor: TColor)… Is this what you meant?

        Wouldn't that be a much too complicated function? Do you really know how to convert clRed and clMoneyGreen to a color according to the skin?

        I would be glad to have a conversion for the standard colors of a themed Windows app. Like clBtnShadow and clInactiveCaptionText. If you mean you can provide a conversion for these kind of colors, that would be great.

        #55086
        Support
        Keymaster
          'HeDiBo' wrote:
          Do you really know how to convert clRed and clMoneyGreen to a color according to the skin?

          Such colors may be leaved unchanged.

          Quote:
          I would be glad to have a conversion for the standard colors of a themed Windows app. Like clBtnShadow and clInactiveCaptionText. If you mean you can provide a conversion for these kind of colors, that would be great.

          function ColorToSkin(AColor: TColor): TColor;

          I think, this function can do that for AlphaSkins, but I don't know how to do it for Windows theme.

          #55100
          HeDiBo
          Participant

            That would be very easy:

            Code:
            function ColorToSkin(AColor: TColor): TColor;
            begin
            if not skinned then Result := AColor
            else begin
            // Here you would do your stuff
            end{if};
            end;

            So I would call the function like this: ColorToSkin(clBtnShadow) and it would return clBtnShadow if not skinning or your equivalent, theme oriented color if skinning was active.

            #55165
            HeDiBo
            Participant

              In 10.30 the function SysColorToSkin is almost what you would expect.

              Only, if the skinmanager used is not active, the color is still translated. That's not the way it should work.

              You see, if you want to write a program that will work OK with or without skinning, the function SysColorToSkin(clBtnShadow) should return the value clBtnShadow if the skinmanager is not active.

              I think, the code for SysColorToSkin should be this:

              Code:
              if ASkinManager = nil then
              ASkinManager := DefaultManager;

              if ( ASkinManager nil ) and
              ( ASkinManager.Active ) then // Added by DB
              case AColor of
              clScrollBar, clBackground, clBtnFace, clAppWorkSpace, clMenu:
              .
              .

              #55171
              Support
              Keymaster

                You are right, such code will be added.

              Viewing 6 posts - 1 through 6 (of 6 total)
              • You must be logged in to reply to this topic.